I have set up an nginx reverse proxy on an Ubuntu 22.04 server and I have successfully obtained ssl certificate from lets encrypt. The two keys are stored here:
/etc/letsencrypt/live/test.ddns.net/fullchain.pem;
/etc/letsencrypt/live/test.ddns.net/privkey.pem
and in my default nginx config I have two paths helloworld
and portainer
. Both paths redirects to docker containers.
server {
listen 80;
listen [::]:80;
server_name test.ddns.net;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name test.ddns.net;
ssl_certificate /etc/letsencrypt/live/test.ddns.net/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/test.ddns.net/privkey.pem;
location /helloworld {
proxy_pass http://localhost:32768;
}
location /portainer {
proxy_pass http://localhost:9000;
}
The helloworld path works as expected and loads an html page with https protocol (so my ngnix config is correct). But portainer path not. I tried port 9000, port 8000, port 9443. Non of them worked. I get 404 error, or request sent via http while expected https, or other errors. Does anyone by chance has the same setup and is able to help me?
Thanks.