[MapProxy] mapproxy behind a reverse proxy and use of X-Script-Name

Anne Blankert anne.blankert at geodan.nl
Thu Mar 21 15:06:02 PDT 2013

Hello list,

another question...

I want to expose a MapProxy wms service to the internet as follows:


But I have a problem to make getCapabilities produce the correct 
resource URLs
If I do a request like:
the resulting getCapabilities is:


My problem is that MapProxy adds the suffix "/map/service/" to 

I would like the request-URL to be completely configuration and 
technology independent (not needing such things as mapserver specific 
map=somemap.map parameters or MapProxy specific configuration ("map") or 
wms service name ("service").

I've set up an Apache reverse proxy like this:

<Location /mywmsservice>
   ProxyPass http://internal_mapproxyhost/mapproxy/map/service
   RequestHeader add X-Script-Name /mywmsservice

I had hoped that MapProxy would replace the script_name and path_info 
part of the URL ("/map/service") by the X-Script-Name ("/mywmsservice"). 
However, the X-Script-Name is not used as a replacement but as a prefix 
to /map/service (result: "/mywmsservice/map/service")

Is there an easy way to prevent MapProxy from appending "/map/service" 
to the X-Script-Name in the getCapabilities output?



President Kennedylaan 1
1079 MB Amsterdam (NL)

T +31 (0)20 - 5711 311
E anne.blankert at geodan.nl
www.geodan.nl <http://www.geodan.nl/> | disclaimer 

More information about the MapProxy mailing list