You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.
When munkiwebadmin is hidden behind a proxy (eg. nginx or Apache), in the admin view all the computers have as address 127.0.0.1 (or whatever the proxy address is). This seems to be caused by /munkiwebadmin/reports/views.py line 61 using machine.remote_ip = request.META['REMOTE_ADDR'].
According to this documentation: http://www.djangobook.com/en/2.0/chapter17.html a piece of middleware should be able to 'fix' that transparently, alternatively an if/then can be used to check whether certain proxy headers are set. When X-Forwarded-For is set, the first IP should be used as the client IP (remote_addr).
The text was updated successfully, but these errors were encountered:
I had this same issue and ended up tweaking the Django settings so it looked at X-Forwarded-For instead of the REMOTE_ADDR.
I can't remember if I had to change the actual MWA code or if this was just a setting in the main project settings.py.
Perhaps it could be argued that if it isn't in settings.py, it should be exposed in such a way so that one does not need to change the core MWA code to get the desired behavior.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When munkiwebadmin is hidden behind a proxy (eg. nginx or Apache), in the admin view all the computers have as address 127.0.0.1 (or whatever the proxy address is). This seems to be caused by /munkiwebadmin/reports/views.py line 61 using machine.remote_ip = request.META['REMOTE_ADDR'].
According to this documentation: http://www.djangobook.com/en/2.0/chapter17.html a piece of middleware should be able to 'fix' that transparently, alternatively an if/then can be used to check whether certain proxy headers are set. When X-Forwarded-For is set, the first IP should be used as the client IP (remote_addr).
The text was updated successfully, but these errors were encountered: