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?