Score:0

Nginx: Reverse Proxy to Docker Container with SSL

es flag

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?

in flag
Your nginx configuration does not contain a server configuration for SSL
John Hanley avatar
cn flag
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/
djdomi avatar
za flag
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
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.