This is an automated archive made by the Lemmit Bot.
The original was posted on /r/selfhosted by /u/Sufficient_Shake_279 on 2023-07-04 20:30:15+00:00.
Hi everyone,
I have configured wireguard and nginx server for reverse proxy. I installed WG clients on 2 different machines (1 Windows computer which is running Plex and 1 raspberry pi which is running pihole & unifi controller). After tunneling both devices I am able to access services within tunnel via tunnel assigned ip. After that I started the configuration of nginx reverse proxy (i'll put my configuration at end) but when I tried to access the services via reverse proxy using configured subdomains it didn't worked as intended. My domain's DNS is hosted with cloudflare and I am confident about my DNS configuration. Can any one please guide me if I am doing things correctly or not?
server{
listen 80;
server_name plex.domain.tld;
location / {
proxy_pass "
http://10.9.0.3:32400/web/
";
}
}
server{
listen 80;
server_name pihole.domain.tld;
location / {
proxy_pass "
http://10.9.0.4/admin/
";
proxy_buffering off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
}
server{
listen 80;
server_name unifi.domain.tld;
location / {
return 301 https://$host$request_uri;
}
}
server{
listen 443 ssl http2;
ssl_certificate /etc/nginx/ssl/mydomaincert.crt;
ssl_certificate_key /etc/nginx/ssl/myprivatekey.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
server_name unifi.domain.tld;
location / {
proxy_pass "
https://10.9.0.4:8443
";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
}
location /wss {
proxy_pass "
https://10.9.0.4:8443
";
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_read_timeout 86400;
}
}