When using the URIPrefix and allowing web access through a reverse proxy (Apache), the header shows "Logged in as: User (from 127.0.01)" where in this case the proxy is on the same host.
I'd like the web interface to be show the client's true address by using the "X-Forwarded-For" header.
I'm digging into the code to put together a patch but any pointers would be appreciated.
When using the URIPrefix and allowing web access through a reverse proxy (Apache), the header shows "Logged in as: User (from 127.0.01)" where in this case the proxy is on the same host.
I'd like the web interface to be show the client's true address by using the "X-Forwarded-For" header.
I'm digging into the code to put together a patch but any pointers would be appreciated.
<!-- github-sync-id:113204540 -->
That said, I have to set the X-Forwarded-For header before the proxy_pass, so perhaps there's something similar you need to do for Apache to pass it through?
What version are you on? I run webadmin through an nginx reverse proxy and I see my real IP in the header.
```
*status ZNC - 1.6.0 - http://znc.in
*status IPv6: yes, SSL: yes, DNS: threads, charset: yes
```
That said, I have to set the `X-Forwarded-For` header before the `proxy_pass`, so perhaps there's something similar you need to do for Apache to pass it through?
<!-- github-comment-id:150889777 -->
I just confirmed using tcpdump that the Apache proxy is making a request with X-Forwarded-For set to my IP correctly.
I just confirmed using tcpdump that the Apache proxy is making a request with X-Forwarded-For set to my IP correctly.
<!-- github-comment-id:150891320 -->
Perhaps mine works because of the line TrustedProxy = 127.0.0.1 in znc.conf. I don't believe any TrustedProxies are set by default.
Perhaps mine works because of the line `TrustedProxy = 127.0.0.1` in znc.conf. I don't believe any TrustedProxies are set by default.
<!-- github-comment-id:150891469 -->
Some options are only in webadmin/controlpanel/znc.conf, nowhere else #1128
Always trust reverse proxy on localhost without additional configuration #1126
closed as potentially bad idea.
Related issues:
- Some options are only in webadmin/controlpanel/znc.conf, nowhere else #1128
- Always trust reverse proxy on localhost without additional configuration #1126
- closed as potentially bad idea.
<!-- github-comment-id:150897859 -->
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 the URIPrefix and allowing web access through a reverse proxy (Apache), the header shows "Logged in as: User (from 127.0.01)" where in this case the proxy is on the same host.
I'd like the web interface to be show the client's true address by using the "X-Forwarded-For" header.
I'm digging into the code to put together a patch but any pointers would be appreciated.
What version are you on? I run webadmin through an nginx reverse proxy and I see my real IP in the header.
That said, I have to set the
X-Forwarded-Forheader before theproxy_pass, so perhaps there's something similar you need to do for Apache to pass it through?ZNC 1.6.1+deb1~ubuntu14.04.0 - http://znc.in
IPv6: yes, SSL: yes, DNS: threads, charset: yes
Maybe there is another Apache setting I need.
I just confirmed using tcpdump that the Apache proxy is making a request with X-Forwarded-For set to my IP correctly.
Perhaps mine works because of the line
TrustedProxy = 127.0.0.1in znc.conf. I don't believe any TrustedProxies are set by default.@dgw Yes! TrustedProxy was the key to making it work! Thank you!
You're quite welcome :)
Related issues: