I have a apache proxy load balancer running. I have a domain wiki.mydomain.com registered to this lb. I am trying to make proxy redirect from wiki.mydomain.com to the backend and below is the virtual hosting.

<VirtualHost *:80>
ServerName wiki.mydomain.com
<IfModule mod_proxy.c>

ProxyRequests Off
ProxyPreserveHost On
ProxyVia On

         <Proxy *>
                AddDefaultCharset off
                Order deny,allow
                Allow from all

ProxyPass /
ProxyPassReverse /

why ProxyPass / doesn't work why ONLY ProxyPass /mediawiki works which matching directory. Can't I make it work with above virtual hosting?

Once Again, how do I send all request from wiki.mydomain.com to with ONLY mod_proxy WITHOUT using Redirect, Rewrite, Alias. I also don't want to use the virtual hosting done for mediawiki on and so I don't want to proxypass / to virtual hosting on the backend as I have to register a domain for this backend, perhaps not required if has internal DNS server but I don't have internal dns running.

Anybody know how to do this with ProxyPass & ProxyPassReverse?. Thank you!


Can you clarify "doesn't work" - what happens when you have this config in place and try to request a page?

If I remember right, you'll need to change MediaWiki's configuration to work in the changed path, as it's very sensitive about those things. It needs to know where the root is, and right now, it's at /../ - which will certainly cause problems with resource loading.

You'll need to adjust the $wgScriptPath and $wgArticlePath config settings in LocalSettings.php, keeping in mind that this will break the communication of anything talking to the wiki server directly without using the proxy (any links, etc, pointing to /mediawiki/something). If anything does need to talk directly instead of through the proxy, then you'll need to make the paths match via both entry points.

  • I am getting error page page not found. And in the address it's changing to http://wiki.mydomain.com/mediawiki/index.php?.... Directly is accessible and I think it changes the address location. – user53864 Feb 8 '12 at 0:41
  • Right - it's configured to do so. See the third paragraph of the answer. – Shane Madden Feb 8 '12 at 1:25
  • Is there any possible way having both accessing directly and also via proxy? – user53864 Feb 8 '12 at 1:35
  • @user53864 Yes; if you can make the paths match. Is there anything else on the server that mediawiki is running on, or can you just move it from /mediawiki/ to /? – Shane Madden Feb 8 '12 at 1:37
  • paths matching hmm.... if paths should match then no way other than doing virtual hosting on and so I should register one more domain. Probably virtual hosting with internal domains can do instead registering domain but I should have DNS installed and running but I don't have and it's cloud servers. Yes, there are other apps also running on Just wondering why proxypass redirect exactly like it's said with haproxy. – user53864 Feb 8 '12 at 3:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.