ngoduykhanh / wireguard-ui

Wireguard web interface
MIT License
3.77k stars 464 forks source link

Need help - Nginx Proxy Manager #577

Closed mrwormo closed 1 month ago

mrwormo commented 1 month ago

Hello,

I need help setting up NPM as a proxy. I run Wireguard-UI in an LXC container under Debian 12 in Proxmox, and NPM in a VM. I followed this tutorial : https://insights.ditatompel.com/en/tutorials/installing-wireguard-ui-to-manage-your-wireguard-vpn-server/

Wireguard-UI is installed in /opt/wireguard-ui/ and seems to be running fine :

wireguard-ui-daemon.service - WireGuard UI Daemon
     Loaded: loaded (/etc/systemd/system/wireguard-ui-daemon.service; enabled; preset: enabled)
     Active: active (running) since Thu 2024-05-02 15:50:47 CEST; 10h ago
   Main PID: 12658 (wireguard-ui)
      Tasks: 4 (limit: 154488)
     Memory: 8.0M
        CPU: 1min 15.632s
     CGroup: /system.slice/wireguard-ui-daemon.service
             `-12658 /opt/wireguard-ui/wireguard-ui -bind-address 127.0.0.1:5000

May 02 15:50:47 WGServer wireguard-ui[12658]: Git Repo        : https://github.com/ngoduykhanh/wireguard-ui
May 02 15:50:47 WGServer wireguard-ui[12658]: Authentication        : true
May 02 15:50:47 WGServer wireguard-ui[12658]: Bind address        : 127.0.0.1:5000
May 02 15:50:47 WGServer wireguard-ui[12658]: Email from        :
May 02 15:50:47 WGServer wireguard-ui[12658]: Email from name        : WireGuard UI
May 02 15:50:47 WGServer wireguard-ui[12658]: Custom wg.conf        :
May 02 15:50:47 WGServer wireguard-ui[12658]: Base path        : /
May 02 15:50:47 WGServer wireguard-ui[12658]: Subnet ranges        :
May 02 15:50:49 WGServer wireguard-ui[12658]: Valid subnet ranges:
May 02 15:50:49 WGServer wireguard-ui[12658]: <E2><87><A8> http server started on 127.0.0.1:5000

On the LXC, I added an nginx with just this config:

server {

    listen 80;
    server_name my.domain.com;

    access_log off;

    location / {

        add_header Cache-Control no-cache;

        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_pass http://127.0.0.1:5000/;
    }
}

And on the NPM, the conf is pretty basic :

image

I reach the authentication page of Wireguard-UI, but even if I am well authenticated (I see furtively the message "logged in successfully"), I stay on the same page without being able to go further.

I don’t understand how to set up reverse proxy on NPM, someone can do that and help me?

mrwormo commented 1 month ago

Hello,

Everything works after restarting the service wireguard-ui-daemon.service.

Sorry for the inconvenience.