Webchat shows IP of webserver when behind proxy
thefeli73 opened this issue ยท 1 comments
Issue Description:
Running the internal webserver behind an nginx proxy results in all messages sent from webchat to be displayed as from the proxy's local IP instead of the client IP.
I believe this is caused by line 21:$client_headers[] = 'X-Forwarded-For: '.$_SERVER['REMOTE_ADDR'];
in web/up.php where REMOTE_ADDR should be replaced by x-real-ip or x-forwarded-for variable but I'm no expert.
My nginx proxy setting are the following
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
proxy_request_buffering off;
proxy_http_version 1.1;
proxy_intercept_errors on;
- Dynmap Version: 3.1-457
- Server Version: Paper 1.16.5-R0.1
- Pastebin of Configuration.txt: default
- Server Host (if applicable): selfhosted.
- Pastebin of crashlogs or other relevant logs: -
- Other Relevant Data/Screenshots:
[x] I have looked at all other issues and this is not a duplicate
[x] I have been able to replicate this