PermaLink Mediawiki and reverse proxy05/07/2005 01:01 AM
I was playing around with mediawiki, which is the engine powering, and had some troubles to have it cooperate with my reverse proxy. First problem was, that mediawiki was constanly redirecting my request to the apache servers port instead of staying in port 80, which is the reverse proxies port. I had to edit the file includes/DefaultSettings.php to get it work. my changes in red:
$wgServer = $wgProto.'://' . $wgServerName;
#if( isset( $_SERVER['SERVER_PORT'] ) && $_SERVER['SERVER_PORT'] != 80 ) {
#       $wgServer .= ":" . $_SERVER['SERVER_PORT'];

The second problem was, that mediawiki always used the reverse proxies IP address instead of the users IP address. My reverse proxy adds the requestors IP in a new field named HTTP_X_FORWARDED_FOR. I found some documentation here and set the parameter
$wgUseSquid = true;

That did it for me.


This page has been accessed 1727 times. .
The weblog represent my personal views and comments and does not represent the views of my current or previous employers or customers.
About me
By Category
The BlogRoll
Christians sites
other Bloggers
netcraft Linux host Blog Admin OpenNTF
Monthly Archive