
Context
I installed various applications using Docker, for example Nextcloud, Jellyfin, etc…
I then used the SWAG reverse proxy for security and convenience (not having to type the IP and port for everything).
I used DuckDNS to run tests before using my own domain.
Problem
My SWAG configuration files didn’t seem to work.
I was constantly getting a 502 error, which means SWAG couldn’t communicate with my containers.
Jellyfin was the exception, though, it worked with it, and I still don’t know why.
Solution
In the SWAG configuration folder, in “config/nginx/proxy-confs”, there is a line named “proxy_pass”.
I had something like this:
set $upstream_app jellyfin;
set $upstream_port 8096;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
The problem came from this line:
set $upstream_app jellyfin;
I had to replace the container name with the server’s local IP, so 192.168.x.x.
(Replace x.x with your actual IP)