tileserver-gl/configuration/nginx.conf
2019-04-24 13:04:30 +02:00

50 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;
proxy_cache_path /etc/nginx/cache levels=1:2 keys_zone=STATIC:100m inactive=24h max_size=30g;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto 'https';
proxy_pass http://localhost:8080;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_cache STATIC;
proxy_cache_valid 200 1d;
proxy_cache_key "$scheme$host$request_uri$cookie_user";
if ($request_uri ~ ^(.*)[_](.*)$) {
add_header 'Access-Control-Allow-Origin' '*';
return 301 https://$host$1-$2;
}
if ($request_uri ~ ^(.*)mono-blw(.*)$) {
add_header 'Access-Control-Allow-Origin' '*';
return 301 https://$host$1mono-blue-water$2;
}
}
}
server {
listen 81;
location / { return 400; }
location = /__isAlive.html {
return 209;
}
}
}