2

I wish to have the following happen:

I have the following Apache configuration. However, this has both http://www.example.com/ and http://www.example.com/wiki be a proxy for http://www.example.com:8080/. How can I correct this?

<VirtualHost *:80>
    ProxyRequests Off
    ProxyPreserveHost On

    <Proxy /wiki>
        Order allow,deny
        Allow from all
    </Proxy>
    ProxyPass        /wiki http://www.example.com:8090/
    ProxyPassReverse /wiki http://www.example.com:8090/

    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>
    ProxyPass        /     http://www.example.com:8080/
    ProxyPassReverse /     http://www.example.com:8080/
</VirtualHost>
2
  • 2
    If the first argument of ProxyPass ends with a trailing /, the second argument should also end with a trailing / and vice versa. Otherwise the resulting requests to the backend may miss some needed slashes and do not deliver the expected results.
    – ALex_hha
    Jul 20 '13 at 13:52
  • Any reason not to use name-based virtual hosting?
    – dawud
    Jul 20 '13 at 15:33
2

I realized that I had my Tomcat server.xml file for the site hosted on 8090 set to

<Context path="/wiki"

Thus, I needed to have

    ProxyPass        /wiki http://www.example.com:8090/wiki
    ProxyPassReverse /wiki http://www.example.com:8090/wiki

in the Apache configuration.

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.