Setup to enable HTTPS with Let’s Encrypt SSL certificates on Nginx (frontend), while Apache remains the backend.
Assuming you've completed this guide: https://uistv-tech.blogspot.com/2025/08/guide-nginx-as-frontend-apache2-as.html
This way:
Clients connect securely to Nginx (443, HTTPS)
-
Nginx proxies requests to Apache (8080, HTTP)
🔐 SSL Setup with Nginx + Apache Backend on Debian LXDE
1. Install Certbot (Let’s Encrypt Client)
On Debian:
2. Ensure Your Domain Points to Your Server
Let’s Encrypt requires a valid domain.
-
Update your DNS A record so your domain (e.g.,
example.com) points to your server’s public IP. -
Test with:
It should resolve to your server IP.
3. Update Nginx Config for Your Domain
Edit your proxy config:
Change it to:
Save, test, and reload:
4. Obtain SSL Certificate
Now run:
-
Certbot will auto-configure HTTPS for your site.
-
If asked:
-
Redirect all HTTP → HTTPS → Choose Yes (recommended).
-
5. Verify Auto-Renewal
Let’s Encrypt certificates last 90 days. Certbot sets up auto-renew by default.
Check with:
If successful, your SSL will auto-renew. ✅
6. (Optional) Force HTTPS (if needed)
Certbot usually adds this automatically. But in case you need to ensure all HTTP traffic redirects to HTTPS, your config will look like this:
7. Restart Nginx
After changes:
8. Final Test
-
Visit 👉
https://example.com -
Browser should show a padlock (valid SSL).
-
Apache backend (8080) serves the content, but users only see HTTPS.
✅ Now you have a secure Nginx (frontend, HTTPS) reverse proxy with Apache backend.
Comments
Post a Comment