Swag proxy-conf for Domoticz

Hello
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 http://192.168.0.10:8080) 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:

 services:

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

   deluge:
        image:  doggosrocko/arch-delugevpn-armhf
        container_name: deluge
        restart: always
        cap_add:
                - NET_ADMIN
        ports:
                - 8112:8112
                - 8118:8118
                - 58846:58846
                - 58946:58946
        environment:
                - PUID=0
                - PGID=0
                - VPN_ENABLED=yes
                - VPN_PROV=pia
                - VPN_USER=xxxxxx
                - VPN_PASS=xxxxxxx
                - ENABLE_PRIVOXY=yes
                - LAN_NETWORK=192.168.0.0/24
                - NAME_SERVERS=209.222.18.222,37.235.1.174,8.8.8.8,209.222.18.218,37.235.1.177,8.8.4.4
                - UMASK=000
                - DEBUG=false
                - DELUGE_DAEMON_LOG_LEVEL=info
                - DELUGE_WEB_LOG_LEVEL=debug
        volumes:
                - /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.)

Hello,

Thank you i have found the answer on domoticz (sorry, i didn’t say it’s Domoticz)
https://www.domoticz.com/wiki/WebServer_Proxy

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;
       proxy_pass http://192.168.0.10:8080;
}

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 192.168.0.10, 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.