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>
cubetwo1729
  • 196
  • 1
  • 2
  • 4
  • 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

1 Answers1

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.

cubetwo1729
  • 196
  • 1
  • 2
  • 4