111 lines
3.6 KiB
Plaintext
111 lines
3.6 KiB
Plaintext
server {
|
|
listen 3000;
|
|
server_name _;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
client_max_body_size 25m;
|
|
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
|
|
|
gzip on;
|
|
gzip_types text/plain text/css application/javascript application/json image/svg+xml;
|
|
|
|
location = /health {
|
|
add_header Content-Type text/plain;
|
|
return 200 "ok\n";
|
|
}
|
|
|
|
location = /api/health {
|
|
proxy_pass http://${PLANET_BACKEND_UPSTREAM}/health;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
location = /api/health/live {
|
|
proxy_pass http://${PLANET_BACKEND_UPSTREAM}/health/live;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
location = /api/health/ready {
|
|
proxy_pass http://${PLANET_BACKEND_UPSTREAM}/health/ready;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
location /api/ {
|
|
proxy_pass http://${PLANET_BACKEND_UPSTREAM}/api/;
|
|
proxy_http_version 1.1;
|
|
proxy_connect_timeout 10s;
|
|
proxy_send_timeout 180s;
|
|
proxy_read_timeout 180s;
|
|
proxy_buffering off;
|
|
proxy_request_buffering off;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
location /ws {
|
|
proxy_pass http://${PLANET_BACKEND_UPSTREAM}/ws;
|
|
proxy_http_version 1.1;
|
|
proxy_connect_timeout 10s;
|
|
proxy_send_timeout 3600s;
|
|
proxy_read_timeout 3600s;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
location /earth-brand-assets/ {
|
|
proxy_pass http://${PLANET_BACKEND_UPSTREAM}/earth-brand-assets/;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
location = /index.html {
|
|
add_header Cache-Control "no-store";
|
|
try_files $uri =404;
|
|
}
|
|
|
|
location /assets/ {
|
|
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
try_files $uri =404;
|
|
}
|
|
|
|
location = /earth/data/boundaries/v1/manifest.json {
|
|
add_header Cache-Control "no-store";
|
|
try_files $uri =404;
|
|
}
|
|
|
|
location ~ ^/earth/data/boundaries/.*\.pmtiles$ {
|
|
types { application/octet-stream pmtiles; }
|
|
add_header Accept-Ranges bytes;
|
|
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
try_files $uri =404;
|
|
}
|
|
|
|
location /earth/data/boundaries/ {
|
|
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
try_files $uri =404;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
}
|