Last modified: 2007-09-16 12:43:14 UTC
Although running mediawiki behind a reverse proxy is common, it is suprisingly difficult to figure out how to have mediawiki honor the X-FORWARDED-FOR header, and the solution is somewhat counter-intuitive (i.e. adding the IP of the proxy to SquidServers). Hopefully this small documentation patch will allow people looking for the keywords related to the problem to find the proper solution. When loooking in the mediawiki web site at the moment, there is no match for "forwarded-for" Index: DefaultSettings.php =================================================================== --- DefaultSettings.php (revision 22142) +++ DefaultSettings.php (working copy) @@ -1230,7 +1230,11 @@ /** * A list of proxy servers (ips if possible) to purge on changes don't specify - * ports here (80 is default) + * ports here (80 is default). When mediawiki is running behind a proxy, its + * address should be listed in $wgSquidServers otherwise mediawiki won't rely + * on the X-FORWARDED-FOR header to determine the user IP address and + * all users will appear to come from the proxy IP address. Don't use domain + * names here, only IP adresses. */ # $wgSquidServers = array('127.0.0.1'); $wgSquidServers = array();
Created attachment 3634 [details] Patch to DefaultSettings.php for documentation purpose.
Committed in r22144.
It seems to say that it's best if the proxy servers be listed as IPs, and then that they _must_ be listed as IPs. Could this be clarified?
Further clarified documentation in 25880.