2020-06-17 10:52:58 +02:00
|
|
|
server {
|
|
|
|
listen 80;
|
|
|
|
listen [::]:80;
|
|
|
|
|
2024-10-04 23:11:27 +02:00
|
|
|
server_name {{ tileserver_domain }};
|
2020-06-17 10:52:58 +02:00
|
|
|
|
|
|
|
location /.well-known/acme-challenge {
|
|
|
|
default_type "text/plain";
|
|
|
|
alias /var/www/acme-challenge;
|
|
|
|
}
|
|
|
|
|
|
|
|
location / {
|
2024-10-04 23:11:27 +02:00
|
|
|
return 301 https://{{ tileserver_domain }}$request_uri;
|
2020-06-17 10:52:58 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-24 22:41:09 +01:00
|
|
|
proxy_cache_path /var/lib/nginx/cache levels=1:2 keys_zone=tilecache:20m inactive=7d max_size=2g;
|
2020-06-17 13:32:51 +02:00
|
|
|
|
2020-06-17 10:52:58 +02:00
|
|
|
server {
|
|
|
|
listen 443 ssl http2;
|
|
|
|
listen [::]:443 ssl http2;
|
|
|
|
|
2024-10-04 23:11:27 +02:00
|
|
|
server_name {{ tileserver_domain }};
|
2020-06-17 10:52:58 +02:00
|
|
|
|
2024-10-04 23:11:27 +02:00
|
|
|
ssl_certificate_key /etc/nginx/ssl/{{ tileserver_domain }}.key;
|
|
|
|
ssl_certificate /etc/nginx/ssl/{{ tileserver_domain }}.crt;
|
2020-06-17 10:52:58 +02:00
|
|
|
|
2020-06-17 20:54:27 +02:00
|
|
|
location ~ /d/(.*\.png|.*\.webp) {
|
2024-10-04 23:11:27 +02:00
|
|
|
proxy_pass http://127.0.0.1:8080/styles/day/$1;
|
2020-06-17 13:32:51 +02:00
|
|
|
|
|
|
|
proxy_cache tilecache;
|
2021-06-14 16:54:09 +02:00
|
|
|
proxy_cache_background_update on;
|
2024-10-04 19:50:00 +02:00
|
|
|
# proxy_cache_lock on;
|
2020-06-17 13:32:51 +02:00
|
|
|
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
|
2021-06-14 16:54:09 +02:00
|
|
|
proxy_cache_valid 200 7d;
|
2020-06-17 13:32:51 +02:00
|
|
|
proxy_cache_valid any 1m;
|
|
|
|
|
|
|
|
proxy_ignore_headers Expires Cache-Control;
|
|
|
|
|
|
|
|
expires 7d;
|
|
|
|
}
|
|
|
|
|
2020-06-17 20:54:27 +02:00
|
|
|
location ~ /n/(.*\.png|.*\.webp) {
|
2024-10-04 23:11:27 +02:00
|
|
|
proxy_pass http://127.0.0.1:8080/styles/night/$1;
|
2020-06-17 13:32:51 +02:00
|
|
|
|
|
|
|
proxy_cache tilecache;
|
2021-06-14 16:54:09 +02:00
|
|
|
proxy_cache_background_update on;
|
2024-10-04 19:50:00 +02:00
|
|
|
# proxy_cache_lock on;
|
2020-06-17 13:32:51 +02:00
|
|
|
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
|
2021-06-14 16:54:09 +02:00
|
|
|
proxy_cache_valid 200 7d;
|
2020-06-17 13:32:51 +02:00
|
|
|
proxy_cache_valid any 1m;
|
|
|
|
|
|
|
|
proxy_ignore_headers Expires Cache-Control;
|
|
|
|
|
|
|
|
expires 7d;
|
2020-06-17 10:52:58 +02:00
|
|
|
}
|
|
|
|
}
|