mirror of
https://github.com/luzifer-docker/osm-proxy.git
synced 2024-12-20 12:41:17 +00:00
Initial version
This commit is contained in:
commit
9561f27c54
2 changed files with 75 additions and 0 deletions
5
Dockerfile
Normal file
5
Dockerfile
Normal file
|
@ -0,0 +1,5 @@
|
|||
FROM nginx:alpine
|
||||
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
|
||||
VOLUME ["/data"]
|
70
nginx.conf
Normal file
70
nginx.conf
Normal file
|
@ -0,0 +1,70 @@
|
|||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue