osm-proxy/nginx.conf
2018-05-11 14:18:51 +02:00

70 lines
1.7 KiB
Nginx Configuration File

user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
gzip on;
proxy_cache_path /data/cache_osm levels=1:2 keys_zone=osm:10m max_size=2g
inactive=7d use_temp_path=off;
upstream openstreetmap {
server a.tile.openstreetmap.org:443;
server b.tile.openstreetmap.org:443;
server c.tile.openstreetmap.org:443;
}
server {
listen 80 default_server;
proxy_cache_background_update on;
proxy_cache_lock on;
proxy_cache osm;
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
proxy_cache_valid 200 404 7d;
proxy_hide_header Set-Cookie;
proxy_hide_header Strict-Transport-Security;
proxy_ignore_headers Cache-Control Set-Cookie;
expires 7d;
add_header X-Cache-Status $upstream_cache_status;
location ~ ^/fire {
rewrite ^/fire(.*)$ /hytiles$1 break;
proxy_pass http://openfiremap.org;
}
location ~/sea {
rewrite ^/sea(.*)$ /seamark$1 break;
proxy_pass http://t1.openseamap.org;
}
location ~ ^/street {
rewrite ^/street(.*)$ $1 break;
proxy_pass https://openstreetmap;
}
}
}