Deploy ML apps with HTTPS & SSL using our step-by-step guide. Secure your apps with industry best practices.

Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
// Update package list
sudo apt-get update
// Install Certbot for Nginx
sudo apt-get install certbot python3-certbot-nginx
/etc/nginx/sites-available/your-domain.com with the following content:
// Nginx configuration snippet for reverse proxy
server {
listen 80;
server\_name your-domain.com www.your-domain.com;
// Redirect all HTTP traffic to HTTPS
return 301 https://$host$request\_uri;
}
server {
listen 443 ssl;
server\_name your-domain.com www.your-domain.com;
// SSL certificate and key locations (will be updated by Certbot)
ssl\_certificate /etc/letsencrypt/live/your-domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/your-domain.com/privkey.pem;
// Recommended SSL settings for security and compatibility
ssl\_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server\_ciphers on;
// Proxy settings for the ML application
location / {
proxy\_pass http://localhost:8000; // Forward requests to your ML backend server
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote\_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
/etc/nginx/sites-enabled/ and restart Nginx:
// Link configuration and restart Nginx
sudo ln -s /etc/nginx/sites-available/your-domain.com /etc/nginx/sites-enabled/
sudo nginx -t // Test configuration for syntax errors
sudo systemctl restart nginx
// Run Certbot to obtain and install the certificate
sudo certbot --nginx -d your-domain.com -d www.your-domain.com
// Dry-run the renewal process
sudo certbot renew --dry-run
https://your-domain.com in your web browser. You should see a secure connection mark (typically a padlock icon).
// Check Nginx error logs
sudo tail -f /var/log/nginx/error.log
// Review your ML application logs for any connection issues or errors
From startups to enterprises and everything in between, see for yourself our incredible impact.
Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We’ll discuss your project and provide a custom quote at no cost.Â