[MapProxy] MultiMap deployment

Jorge Gaspar Sanz Salinas jsanz at osgeo.org
Wed Aug 24 04:36:04 EDT 2011


El 23/08/11 15:21, Oliver Tonnhofer escribió:
> 
> On 23.08.2011, at 14:31, Jorge Gaspar Sanz Salinas wrote:
>> I'm having troubles exposing a MapProxy (1.2.0b1) using gunicorn through
>> a reverse proxy.
>>
>> When I access gunicorn directly everything runs fine but accessing
>> through apache or nginx are having some problems with the script_name
>> and path_info.
>>
>> OK with nginx I have this configuration:
>>
>>        location /mapproxy {
>>                proxy_pass http://localhost:8080; #gunicorn
>>                proxy_set_header Host $http_host;
>>                proxy_set_header X-Script-Name /mapproxy;
>>        }
> 
> Right, thats the correct setup. The X-Script-Name tells MapProxy that all URLs need to start with /mapproxy and the Host that all URLs should use the hostname of the frontend proxy and not localhost:8080.
> 
>> The result is that mapproxy runs well except for some urls not well
>> writen on the output HTML.
>>
>> For example when I access to http://server/mapproxy/conf1/
>>
>> The demo link is http://server/mapproxy/demo/ instead of
>> http://server/mapproxy/conf1/demo/
> 
> Ok, thats a bug related to the use of MultiMapProxy. I fixed that. 
> 
> 
>> On Apache reverse proxy (mod_proxy) I had a similar problem (I got
>> http://server/conf1/demo/).
> 
> You need to pass that X-Script-Header to MapProxy. Maybe mod_headers can do that? I don't know much about Apache, but maybe someone else knows how to do this. 
> 
> 

Ok I've passed it on Apache

RequestHeader add X-Script-Name "/mapproxy"

And now I'm getting the same behavior of nginx (lacking the conf part of
the url).

I want to add that this is not a big deal, it affects to some reports on
the demo service, as far as I know.

Best


> Regards,
> Oliver
> 


-- 
Jorge Gaspar Sanz Salinas
http://es.osgeo.org
http://jorgesanz.net


More information about the MapProxy mailing list