164 lines
6.2 KiB
Nginx Configuration File
164 lines
6.2 KiB
Nginx Configuration File
worker_processes 1;
|
|
error_log "D:/Code/Insar_management_system_v2/logs/nginx_error.log" warn;
|
|
pid "D:/Code/Insar_management_system_v2/logs/nginx.pid";
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
http {
|
|
include mime.types;
|
|
default_type application/octet-stream;
|
|
access_log "D:/Code/Insar_management_system_v2/logs/nginx_access.log";
|
|
client_body_temp_path "D:/Code/Insar_management_system_v2/nginx/temp/client_body";
|
|
proxy_temp_path "D:/Code/Insar_management_system_v2/nginx/temp/proxy";
|
|
fastcgi_temp_path "D:/Code/Insar_management_system_v2/nginx/temp/fastcgi";
|
|
uwsgi_temp_path "D:/Code/Insar_management_system_v2/nginx/temp/uwsgi";
|
|
scgi_temp_path "D:/Code/Insar_management_system_v2/nginx/temp/scgi";
|
|
|
|
sendfile on;
|
|
keepalive_timeout 65;
|
|
# Large D-InSAR batch saves can exceed nginx's default 1m request body limit.
|
|
client_max_body_size 32m;
|
|
|
|
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
include "D:/Code/Insar_management_system_v2/nginx/client_allow.conf";
|
|
error_page 403 /__access_denied.html;
|
|
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header X-XSS-Protection "1; mode=block" always;
|
|
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
|
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https://*.tile.openstreetmap.org https://*.tile.opentopomap.org; connect-src 'self'; font-src 'self' data:; worker-src blob:;" always;
|
|
|
|
root "D:/Code/Insar_management_system_v2/frontend/dist";
|
|
index index.html;
|
|
|
|
location = /index.html {
|
|
try_files /index.html =404;
|
|
add_header Cache-Control "no-store, no-cache, must-revalidate" always;
|
|
}
|
|
|
|
location /assets/ {
|
|
try_files $uri @asset_not_found;
|
|
add_header Cache-Control "public, max-age=31536000, immutable" always;
|
|
}
|
|
|
|
location @asset_not_found {
|
|
add_header Cache-Control "no-store, no-cache, must-revalidate" always;
|
|
return 404;
|
|
}
|
|
|
|
location = /__access_denied.html {
|
|
internal;
|
|
allow all;
|
|
root "D:/Code/Insar_management_system_v2/frontend/dist";
|
|
try_files /access_denied.html =403;
|
|
default_type text/html;
|
|
sub_filter_once off;
|
|
sub_filter "__CLIENT_IP__" "$remote_addr";
|
|
sub_filter "__REQUEST_HOST__" "$host";
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
location /api/cluster/ {
|
|
proxy_pass http://127.0.0.1:18000;
|
|
proxy_http_version 1.1;
|
|
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;
|
|
client_max_body_size 64g;
|
|
proxy_request_buffering off;
|
|
proxy_buffering off;
|
|
proxy_read_timeout 7200s;
|
|
proxy_send_timeout 7200s;
|
|
send_timeout 7200s;
|
|
}
|
|
|
|
location /api/ {
|
|
proxy_pass http://127.0.0.1:18000;
|
|
proxy_http_version 1.1;
|
|
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 /tiles/ {
|
|
proxy_pass http://127.0.0.1:8910;
|
|
proxy_http_version 1.1;
|
|
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;
|
|
proxy_cache_valid 200 365d;
|
|
expires 365d;
|
|
add_header Cache-Control "public, max-age=31536000, immutable" always;
|
|
}
|
|
|
|
location /geojson/ {
|
|
proxy_pass http://127.0.0.1:8910;
|
|
proxy_http_version 1.1;
|
|
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 /shp/ {
|
|
proxy_pass http://127.0.0.1:8910;
|
|
proxy_http_version 1.1;
|
|
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 /vectors/ {
|
|
proxy_pass http://127.0.0.1:8910;
|
|
proxy_http_version 1.1;
|
|
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;
|
|
}
|
|
|
|
# SSE: disable buffering so events are pushed immediately
|
|
location /api/tasks/runtime-summary/stream {
|
|
proxy_pass http://127.0.0.1:18000;
|
|
proxy_http_version 1.1;
|
|
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;
|
|
proxy_buffering off;
|
|
proxy_cache off;
|
|
proxy_read_timeout 3600s;
|
|
proxy_set_header Connection '';
|
|
}
|
|
|
|
location /api/tasks/active/stream {
|
|
proxy_pass http://127.0.0.1:18000;
|
|
proxy_http_version 1.1;
|
|
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;
|
|
proxy_buffering off;
|
|
proxy_cache off;
|
|
proxy_read_timeout 3600s;
|
|
proxy_set_header Connection '';
|
|
}
|
|
|
|
location /image_cache/ {
|
|
alias "D:/Code/Insar_management_system_v2/backend/image_cache/";
|
|
}
|
|
}
|
|
}
|