Files
tilemap_generator/nginx/default.conf
T

31 lines
1.0 KiB
Plaintext

server {
listen 80;
listen [::]:80;
server_name _;
root /var/lib/arma-tiles;
etag on;
# Keep these at server level. Named fallback locations inherit them, so each
# response has exactly one CORS value instead of the invalid "*, *".
add_header Cache-Control "public, max-age=86400, stale-while-revalidate=604800" always;
add_header Access-Control-Allow-Origin "*" always;
add_header Access-Control-Allow-Methods "GET, HEAD, OPTIONS" always;
add_header Access-Control-Allow-Headers "Origin, Range, Accept" always;
# Public API is x/y/z. try_files performs an internal lookup at z/x/y.png.
location ~ ^/tiles/(?<tile_x>[0-9]+)/(?<tile_y>[0-9]+)/(?<tile_z>[0-9]+)$ {
if ($request_method = OPTIONS) {
return 204;
}
try_files /tiles/$tile_z/$tile_x/$tile_y.png @callback_provider_tile;
}
include /etc/nginx/includes/callback-provider.conf;
# metadata.json and internal z/x/y.png paths are intentionally not public.
location / {
return 404;
}
}