Nginx UI through Wireguard reddit / selfhosted ---------------------------------------------------------------------- Plenty-Kaleidoscope2 · 2023-12-19 17:29 Hello everyone! First of all, I want to say that this subreddit is amazing, I’ve learned so much thanks to you! I’ve just bought a VPS to try to deploy things outside of my home network and I’m dealing with some problems to deploy my apps, I hope you could help me. Everything is on the same server and deployed using docker. I have a nginx container deployed with this docker-compose : version: '3' services: app: image: 'jc21/nginx-proxy-manager:latest' restart: unless-stopped ports: - '80:80' #- '127.0.01:81:81' - '443:443' volumes: - ./data:/data - ./letsencrypt:/etc/letsencrypt networks: - gateway networks: gateway: name: npm_gateway I want to have access to the GUI on port 81, but not exposed it to everyone and accessible only via VPN. So I’ve tried to use 127.0.0.1:81 and use a VPN (wireguard) like this : version: "2.1" services: wireguard: image: linuxserver/wireguard container_name: wireguard cap_add: - NET_ADMIN - SYS_MODULE environment: - PUID=1001 - PGID=1001 - TZ=Europe/Paris - SERVERURL= - SERVERPORT=51820 - PEERS=PC - PEERDNS=auto - INTERNAL_SUBNET=10.13.13.0 - ALLOWEDIPS=0.0.0.0/0 volumes: - /home/debian/wireguard/config:/config - /lib/modules:/lib/modules ports: - 51820:51820/udp restart: unless-stopped I can connect to the VPN but can’t find a way to reach the port 81 of nginx… I think I mess with the network part and the exposition of nginx but to be honest, I don’t really understand what am I supposed to modify in the docker compose. Do I need to create a big network « wireguard_network » and put nginx in it ? Then, connect to the VPN and in a navigator access 10.13.13.3:81 or something similar ? Thanks a lot for your help 🙏 ---------------------------------------------------------------------- rohit_267 · 2023-12-19 17:50 you can put both the containers in same bridge network and try to access it. ---------------------------------------------------------------------- arcadianarcadian · 2023-12-19 21:22 change wireguard network\_mode to host, then you can easily connect to NGINX through [10.13.13.3:81](https://10.13.13.3:81) ​ version: "3" networks: proxy-network: external: true services: subspace: image: subspacecommunity/subspace:latest container_name: subspace restart: always network_mode: host environment: - SUBSPACE_HTTP_HOST=vpn.example.com - SUBSPACE_LETSENCRYPT=false - SUBSPACE_HTTP_INSECURE=true - SUBSPACE_HTTP_ADDR="172.18.0.1:8000" - SUBSPACE_NAMESERVERS=1.1.1.1,8.8.8.8 - SUBSPACE_LISTENPORT=51820 - SUBSPACE_IPTABLES_DISABLED=1 - SUBSPACE_IPV4_POOL=10.99.97.0/24 - SUBSPACE_IPV4_GW=10.99.97.1 - SUBSPACE_DISABLE_DNS=0 cap_add: - NET_ADMIN nginx-proxy-manager: container_name: nginx-proxy-manager image: 'jc21/nginx-proxy-manager:latest' restart: unless-stopped environment: ports: - '443:443' - '10.99.97.1:81:81' volumes: - /opt/data/nginx-manager/data:/data - /opt/data/nginx-manager/letsencrypt:/etc/letsencrypt networks: - proxy-network ---------------------------------------------------------------------- Nojo777 · 2023-12-20 22:29 Instead of binding nginx gui to 127.0.0.1:81:81, bind it to the wireguard client ip. For example: 10.13.13.1:81:81.