Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- proxy_cache_path /var/www/cache levels=1:2 keys_zone=tiles:8m max_size=1G;
- proxy_temp_path /var/www/cache/tmp;
- upstream openstreetmap_backend {
- server a.tile.openstreetmap.org;
- server b.tile.openstreetmap.org;
- server c.tile.openstreetmap.org;
- }
- server {
- #... other config
- # Use tiles pattern URL '/tiles/{z}/{x}/{y}.png' (relative)
- location /tiles/ {
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X_FORWARDED_PROTO http;
- proxy_set_header Host $http_host;
- proxy_cache tiles;
- proxy_cache_valid 200 302 30d;
- proxy_cache_valid 404 1m;
- proxy_cache_key "$request_uri";
- proxy_redirect off;
- proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
- add_header X-Cache-Status $upstream_cache_status;
- expires 7d;
- add_header Cache-Control public;
- add_header Last-Modified "";
- add_header ETag "";
- proxy_pass http://openstreetmap_backend/;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement