[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:

http://servicehost/mywmsservice

But I have a problem to make getCapabilities produce the correct 
resource URLs
If I do a request like:
 
http://servicehost/mywmsservice?request=getcapabilities&version=1.1.1&service=wms
the resulting getCapabilities is:

...
<GetMap>
         <Format>image/jpeg</Format>
       <DCPType>
         <HTTP>
           <Get><OnlineResource 
xmlns:xlink="http://www.w3.org/1999/xlink" 
xlink:href="http://servicehost/mywmsservice/map/service/?"/></Get>
         </HTTP>
       </DCPType>
     </GetMap>
...

My problem is that MapProxy adds the suffix "/map/service/" to 
http://servicehost/mywmsservice

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
</Location>

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?

Thanks,

Anne



-- 
--------------------------------------
*Geodan*
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 
<http://www.geodan.nl/disclaimer>
--------------------------------------




More information about the MapProxy mailing list