When using Nginx to proxy the webadmin so it can bind to port 80 (Without running as root), it shows the localhost IP of 127.0.0.1 when logging in and out. I have Nginx is a proper proxy setup where it passes the real IP of the user to the Webadmin.
As for ZNC, I have it set to only bind the webadmin to localhost on port 5000. It works correctly, all except it is displaying the wrong IP (Image attached).
EDIT: This is ZNC v1.4.
When using Nginx to proxy the webadmin so it can bind to port 80 (Without running as root), it shows the localhost IP of 127.0.0.1 when logging in and out. I have Nginx is a proper proxy setup where it passes the real IP of the user to the Webadmin.
My Nginx config:
```
server {
listen 80;
listen [::]:80;
server_name DOMAIN.TLD;
#add_header Strict-Transport-Security "max-age=31536000";
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl spdy;
listen [::]:443 ssl spdy;
index index.html index.htm;
server_name DOMAIN.TLD;
# Logging
access_log /srv/http/DOMAIN.TLD/log/access.log;
error_log /srv/http/DOMAIN.TLD/log/error.log warn;
# Custom Stuff
ssl_certificate /etc/nginx/ssl/znc.crt;
ssl_certificate_key /etc/nginx/ssl/znc.key;
location ~ /\. {
deny all;
}
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass https://127.0.0.1:5000;
}
}
```
As for ZNC, I have it set to only bind the webadmin to localhost on port 5000. It works correctly, all except it is displaying the wrong IP (Image attached).

EDIT: This is ZNC v1.4.
<!-- github-sync-id:47989247 -->
<harpyon> Okay, here's what I did, jreese: Build ZNC 1.5 (git), add "TrustedProxy = 127.0.0.1" to root znc.conf, and "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;" to nginx conf. It werkz!
`<harpyon> Okay, here's what I did, jreese: Build ZNC 1.5 (git), add "TrustedProxy = 127.0.0.1" to root znc.conf, and "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;" to nginx conf. It werkz!`
https://github.com/znc/znc/issues/177
This is in 1.5 git
<!-- github-comment-id:62017300 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
When using Nginx to proxy the webadmin so it can bind to port 80 (Without running as root), it shows the localhost IP of 127.0.0.1 when logging in and out. I have Nginx is a proper proxy setup where it passes the real IP of the user to the Webadmin.
My Nginx config:
As for ZNC, I have it set to only bind the webadmin to localhost on port 5000. It works correctly, all except it is displaying the wrong IP (Image attached).
EDIT: This is ZNC v1.4.
I'm guessing that ZNC doesn't check/listen for the X-Forwarded-For or X-Real-IP headers...
Duplicate of: https://github.com/znc/znc/issues/177 & https://github.com/znc/znc/issues/317
Fixed by: https://github.com/znc/znc/pull/349
<harpyon> Okay, here's what I did, jreese: Build ZNC 1.5 (git), add "TrustedProxy = 127.0.0.1" to root znc.conf, and "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;" to nginx conf. It werkz!https://github.com/znc/znc/issues/177
This is in 1.5 git
Ah, ok. Thanks!