0

On my Ubuntu (20) server I have a Docker container running on port 3000. I have now installed NGINX on the server and point a domain via a reverse proxy to the Docker container.

server {
    listen 80;
    server_name sub.domain.com;

    location / {
        proxy_pass http://localhost:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

I installed an SSL certificate via Certbot and assigned it to the domain. The problem is that the domain cannot be accessed via HTTPS.

However, if I point the domain to a directory and display a simple HTML file, it works.

Where is the error?

Jonas
  • 101
  • 1
    Your nginx configuration does not contain a server configuration for SSL – Gerald Schneider Oct 11 '21 at 16:25
  • What does your comment mean? *if I point the domain to a directory and display a simple HTML file, it works** The Nginx configuration does not support SSL. That means that pointing to a directory would not work either. This tutorial might help you: https://blog.ssdnodes.com/blog/how-to-use-nginx-as-a-reverse-proxy-with-ssl-tutorial/ – John Hanley Oct 11 '21 at 17:01
  • I agreee, you need to show the full config, there is no config part currently, that shows how you use port 443 or similar for SSL – djdomi Oct 17 '21 at 12:25

0 Answers0