Files
planet/frontend/nginx.conf.template
T
linkong 41059ca42a
ci / backend (push) Canceled after 0s
ci / frontend (push) Canceled after 0s
ci / delivery (push) Canceled after 0s
release: bump version to 0.80.0
2026-11-26 10:50:38 +08:00

125 lines
3.9 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_proxied any;
gzip_vary on;
gzip_min_length 1024;
gzip_comp_level 5;
gzip_types text/plain text/css application/javascript application/json application/wasm 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 /earth/vendor/mediapipe/ {
types {
text/javascript mjs js;
application/wasm wasm;
application/octet-stream task;
}
add_header Cache-Control "public, max-age=31536000, immutable";
try_files $uri =404;
}
location / {
try_files $uri $uri/ /index.html;
}
}