Nginx RP + Certbot Issue

Domain:

Current Setup:
Alibaba cloud Ubuntu 18.04 instance:

  1. Nginx Reverse Proxy
  2. Certbot
  3. Docker (Hosting Python Flask Web Server on Port 3389)

The idea was to use Nginx + certbot as a reverse proxy to encrypt and relay all traffic to and from the python server in the Docker container. But after setting it up, when I entered the website, it redirects to port 3389 which isn't secure. So it redirects the traffic but doesn't encrypt it. However SSL Labs shows that there is SSL

I followed this guide: https://www.scaleway.com/en/docs/how-to-configure-nginx-reverse-proxy/

I only edited 2 files - nginx.conf and reverse-proxy.conf

Untitled

xxxxx:/etc/nginx/site-available$ cat reverse-proxy.conf

server {
listen 443;
listen [::]:443;

    access_log /var/log/nginx/reverse-access.log;
    error_log /var/log/nginx/reverse-error.log;

    location / {
                proxy_pass http://127.0.0.1:3389;

}
}

I'm not entirely sure if my conf settings are wrong or if the entire system design isn't correct. Would appreciate assistance.

Thanks in advance!

Hi @kuporia

please read your screenshot.

Your https port 443 redirects to http + 3389.

So the result is expected, exact what you have defined.

If you don't want that, remove that.

1 Like

Thank you so much! My friend wrote that line and I overlooked it entirely thinking it was autogenerated by certbot. Would have never realized it without your help!

2 Likes

That redirect skips the proxy definition. So that can't work.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.