Swag proxy-conf for Domoticz

i have a problem with my swag setup, i can’t reverse-proxy some local ip. Some work, others don’t
I have a 404 or 502 error, but if i curl the server (eg from the container and from the host, it responds.
I have a doubt about the network_mode to choose.
Here is my docker compose for the stack i created in portainer:


       image: linuxserver/swag
       container_name: swag
          - NET_ADMIN
          - PUID=1000
          - PGID=1000
          - TZ=Europe/Paris
          - URL=xxxxxxxxxxx
          - VALIDATION=http
          - 443:443
          - 80:80
          - /volume1/Docker/Swag/config/:/config
          - /var/log/auth.log:/log/host_ssh_auth.log:ro
          - /volume1/Docker/LetsEncrypt/etc:/config/etc
       restart: always

        image:  doggosrocko/arch-delugevpn-armhf
        container_name: deluge
        restart: always
                - NET_ADMIN
                - 8112:8112
                - 8118:8118
                - 58846:58846
                - 58946:58946
                - PUID=0
                - PGID=0
                - VPN_ENABLED=yes
                - VPN_PROV=pia
                - VPN_USER=xxxxxx
                - VPN_PASS=xxxxxxx
                - ENABLE_PRIVOXY=yes
                - LAN_NETWORK=
                - NAME_SERVERS=,,,,,
                - UMASK=000
                - DEBUG=false
                - DELUGE_DAEMON_LOG_LEVEL=info
                - DELUGE_WEB_LOG_LEVEL=debug
                - /volume1/Docker/Swag/config/deluge:/config
                - /volume1/Media/Downloads:/data
                - /etc/localtime:/etc/localtime:ro

Hey, I’d like to start off by providing this common issues troubleshooting link which covers 404 and 502. SWAG setup - LinuxServer.io

take a look there and see if it helps you resolve your issues.

Assuming you’re trying to reverse proxy deluge, it’s possibly some whitelist, but it’s not our container so I cant say.

You didn’t define a network_mode, so it should be using a custom bridge, however, portainer sometimes causes problems which is why we do not support deploying containers via portainer at all. So, if the 404/502 tshooting guide i linked doesnt help you, try deploying this directly from docker-compose (NOT “docker-compose” in portainer.)


Thank you i have found the answer on domoticz (sorry, i didn’t say it’s Domoticz)

location /Domoticz {
    return 301 $scheme://$host/Domoticz/;

location /Domoticz/ {
       # enable the next two lines for http auth
       auth_basic "Restricted";
       auth_basic_user_file /config/nginx/.htpasswd;

       rewrite ^/Domoticz/?(.*) /$1 break;
       proxy_http_version       1.1;
       proxy_read_timeout       90;
       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;
       proxy_set_header         X-Scheme $scheme;
       proxy_set_header         Upgrade $http_upgrade;
       proxy_set_header         Connection $connection_upgrade;
       add_header               X-Frame-Options SAMEORIGIN;

that is definitely not your best solution when using swag.
reverse-proxy-confs/domoticz.subfolder.conf.sample at master · linuxserver/reverse-proxy-confs (github.com)
would be the proper solution with a change of the upstream_app from domoticz to, which is inefficient, but required when improper docker networking is used.

glad you found a way to resolve your issue, regardless of whether it was the right solution or not :smiley:

This topic was automatically closed after 0 minutes. New replies are no longer allowed.