[MapProxy] Nginx, TMS and missing tiles

Luca Casagrande luca.casagrande at gmail.com
Thu Feb 9 04:04:24 EST 2012


Hi Larry,

thank you for your answer.
The problem is related to the local cache structure..nginx is looking for:

/home/luca/mymapproxy/cache_data/osm_cache_EPSG900913/0/0/0.png" 
failed (2: No such file or directory)

but the default structure is different. So I tried to switch to tms 
using directory_layout [1], but the structure remains the same.
Probably I am missing something, but I'd like to serve 2 or 3 layers 
using this approach.

[1] http://mapproxy.org/docs/1.3.0/caches.html#file

Ciao
Luca


On 09/02/2012 01:16, Larry Shaffer wrote:
> Hi Luca,
>
> I'm not following you. Does your configuration work for existing
> directory structures? If not, what errors are you seeing?
>
> You can add expire headers with MapProxy and none with Nginx to
> differentiate which app served the tile, when you look in response
> logs, like in FireBug.
>
> Alternatively, you could seed the cache with single-colored tiles for
> existing map tiles (or change existing cached tiles to a single
> color), with regular map tiles served from MapProxy. After clearing
> all browser caches, you would should then 'see' when tiles were not
> being served from the cache, and when they were. (I have not tested
> this though.)
>
> Larry Shaffer
> Dakota Cartography
> Black Hills, South Dakota
>
>
>
> On Tue, Feb 7, 2012 at 10:20 AM, Luca Casagrande
> <luca.casagrande at gmail.com>  wrote:
>> On 03/02/2012 13:45, Oliver Tonnhofer wrote:
>>> On 03.02.2012, at 13:32, Luca Casagrande wrote:
>>>> Thanks for your suggestion, I'll take a look to Varnish.
>>>> If the same machine should do also a standard WMS service, it's still
>>>> good to use this approach? I though about Nginx for TMS and Apache for WMS,
>>>> but I am not sure about this solution.
>>>
>>> That should be fine. WMS responses don't contain Cache-Controll header, so
>>> Varnish shouldn't try to cache WMS responses.
>>>
>>> Regards,
>>> Oliver
>>>
>> Hello everybody,
>> I'm moving on with my "experiments" :)
>> Now I'm using MapProxy with Gunicorn and Nginx as a proxy and all is working
>> fine, but now I'd like to have Nginx to serve tiles already there.
>> This is an approach to this task:
>>
>> location ~/tms/1\.0\.0/(.*)_(.*)/(.*)$ {
>>               alias /home/luca/mymapproxy/cache_data/$1_cache_$2/$3;
>>               add_header X-Static super;
>>               try_files $uri @proxy_to_app;
>>       }
>>
>> Now the problem is to have the same structure; I tried using
>> directory_layout: tms but it seems that the output is the same of tc.
>> Probably I am missing something about this kind of task.
>>
>> Thank you very much for your valuable help
>>
>> Luca
>>
>>


-- 
Luca Casagrande
"I love it when a plan comes together."
http://www.lucacasagrande.net



More information about the MapProxy mailing list