This repository has been archived by the owner on Oct 30, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx-tilecache
54 lines (45 loc) · 1.9 KB
/
nginx-tilecache
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#
# Nginx >= 1.9.15 - 1.10.1 recommended
#
# Thanks to https://github.com/cbricart
proxy_cache_path /var/www/tilecache/osm
levels=1:2 inactive=7d
keys_zone=tilecache:64m
max_size=500M;
upstream osm_tiles {
server a.tile.openstreetmap.org;
server b.tile.openstreetmap.org;
server c.tile.openstreetmap.org;
keepalive 16;
}
server {
listen 127.0.0.1:8090 ;
access_log /var/www/tilecache/logs/access.log;
error_log /var/www/tilecache/logs/error.log;
root /var/www/tilecache/html;
location / {
try_files $uri @osm;
}
location @osm {
proxy_pass http://osm_tiles;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Accept-Encoding "";
proxy_set_header User-Agent "Mozilla/5.0 (compatible; OSMTileCache/1.0; +mailto:[email protected]; +https://map.freifunk-suedholstein.de/)";
proxy_set_header Host tile.openstreetmap.org;
proxy_temp_path /var/www/tilecache/temp;
proxy_cache tilecache;
proxy_store off;
proxy_cache_key $uri$is_args$args;
proxy_ignore_headers Expires Cache-Control;
proxy_cache_valid 200 301 302 7d;
proxy_cache_valid 404 1m;
proxy_cache_valid any 1m;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504 http_403 http_404;
proxy_cache_use_stale error timeout updating invalid_header http_500 http_502 http_503 http_504 http_403 http_404;
proxy_hide_header Via;
proxy_hide_header X-Cache;
proxy_hide_header X-Cache-Lookup;
expires 7d;
}
}