ngoduykhanh / wireguard-ui

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

apache and wireguard-ui config #538

Open NextGenerationcloud opened 5 months ago

NextGenerationcloud commented 5 months ago

/etc/apache2/sites-available/wg.conf Header always sets Cache-Control to “no-cache”

Proxy pass settings for the backend server

  ProxyPass /wireguard http://10.34.34.11:5000
  ProxyPassReverse /wireguard http://10.34.34.11:5000

  # Rewrite the Set-Cookie header for the domain name and path
  ProxyPassReverseCookieDomain /wireguard http://10.34.34.11:5000
  ProxyPassReverseCookiePath /wireguard http://10.34.34.11:5000

  Error log ${APACHE_LOG_DIR}/wireguard.error
  CustomLog ${APACHE_LOG_DIR}/wireguard.access combined

ErrorLog /var/www/web-logs/wireguard-logs/error.log LogLevel warning CustomLog /var/www/web-logs/wireguard-logs/access.log combined

sudo systemctl status wireguard-daemon.service

Wireguard-ui[298798]: Git Repo: https://github.com/ngoduykhanh/wireguard-ui Wireguard-ui[298798]: Authentication: true Wireguard-ui[298798]: Bind address: 10.34.34.11:5000 Wireguard-ui[298798]: Email from: wireguard-ui[298798]: Name email address: WireGuard UI Wireguard-ui[298798]: Custom wg.conf: Wireguard-ui[298798]: Base path: /wireguard/ Wireguard-ui[298798]: Subnet ranges: Wireguard-ui[298798]: Valid subnet ranges: Wireguard-ui[298798]: ⇨ http server started on 10.34.34.11:5000

http://10.34.34.11:5000/wireguard/login?next=/wireguard (http) is ok

https://10.34.34.11/wireguard/ (https) is not OK

Message not found"

What am I doing wrong, what am I still missing??

I wanted to set it up later from 127.0.0.1 but it just doesn't work. Can anyone help me?

I thank you in advance ^^

nebulosa2007 commented 5 months ago

Wireguard-UI works only on http not https.

NextGenerationcloud commented 5 months ago

but for nginx there seems to be one that works Oo?

server { listen 80; server_name wgui-cust.netbox.host; root /usr/share/nginx; return 301 https://$host$request_uri; }

server { listen 443 ssl http2; server_name wgui.example.com;

ssl_certificate     /etc/ssl/certs/yourcert.crt;
ssl_certificate_key /etc/ssl/private/yourkey.key;

root /usr/share/nginx;
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/;
}

}