I have been using apache's ProxyPass command to proxy


as follows:

    ProxyPass /geoserver http://localhost:8082/geoserver
    ProxyPassReverse /geoserver http://localhost:8082/geoserver

This works fine until I change the source path to

    ProxyPass /geoserver1 http://localhost:8082/geoserver
    ProxyPassReverse /geoserver1 http://localhost:8082/geoserver

When changed to above, If I go to


in a browser, it will be redirected to


automatically, without the port number. And then this gives an error of 404, address not found.

This happens if the source is anything other than /geoserver and the destination is


(I suspect this has something to do with the automatic redirect from




But I am not sure whether this is the case.

How do I fix it?

This is with GeoServer 2.5 in osgeo live 8

  • I see I have the same issue but it's not restricted to GeoServer, It appears to be Tomcat related. – nmtoken Oct 7 '16 at 12:33

The issue is to do with the Tomcat settings and not with any settings of GeoServer.

Note the Tomcat docs tell us:

It should be noted that it is not recommended to use a reverse proxy to change the context path because of the multiple issues it creates.

So if you want to run GeoServer under a different name you might consider changing the name of the GeoServer war file deployed, or changing the name in a context file, but if you really want to use the proxy settings the following worked for me:

In httpd.conf

ProxyRequests Off
ProxyPreserveHost On

<Proxy /gs/>
    Require all granted
ProxyPass /gs/ ajp://
ProxyPassReverse /gs/ ajp://

In server.xml

    <!-- having useRelativeRedirects set as true is the important bit! -->
  • In my case, I'm not trying to change the name of the context, but to avoid having to specify it (http://geoserver.domain/ should be proxying to http://localhost:8080/geoserver/). I suspect that the problem is still the useRelativeRedirects setting. – Auspex Jun 12 '18 at 10:35

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.