I am running a geodjango application with mapnik and tilecache. Currently tilecache is run on another server to decrease the load on the application server. The application server has nginx as the webserver while tilecache is run on the apache server. Now we have a requirement that necessitates us to put both the map and application parts in the same server.

Could you please tell me how to configure tilecache url in nginx server?


This would work, but it's a poor mans tilecache:

# An nginx tilecache
proxy_cache_path /tmp/tilecache levels=1:2:2 keys_zone=tilecache:256m;

server {
  listen 88 default;
  server_name tc.yourdomain.com;

  #root /www/tc;

  access_log /var/log/nginx/tiles_access.log combined;
  error_log /var/log/nginx/tiles_error.log info;

  add_header X-Cached $upstream_cache_status;

  location / {
    proxy_pass http://tile.openstreetmap.org/ ;
    proxy_cache tilecache;
    proxy_cache_key "$scheme$host$request_uri";
    proxy_cache_valid 200 302 300h;
    proxy_cache_valid 404 1m;

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.