# Put this server block in the BaoTa site's Nginx config. # Replace server_name with your domain, or keep _ for IP-based access. server { listen 8000; server_name _; root /www/wwwroot/dm-ui/dist; index index.html; client_max_body_size 20m; gzip on; gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss image/svg+xml; location / { try_files $uri $uri/ /index.html; } location ^~ /assets/ { try_files $uri =404; expires 30d; add_header Cache-Control "public, immutable"; } location ^~ /prod-api/resource/sse { rewrite ^/prod-api/(.*)$ /$1 break; proxy_pass http://127.0.0.1:8080; 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_send_timeout 3600s; } location ^~ /prod-api/resource/websocket { rewrite ^/prod-api/(.*)$ /$1 break; proxy_pass http://127.0.0.1:8080; 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_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_read_timeout 3600s; proxy_send_timeout 3600s; } location ^~ /prod-api/ { rewrite ^/prod-api/(.*)$ /$1 break; proxy_pass http://127.0.0.1:8080; 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_read_timeout 300s; proxy_send_timeout 300s; } location = /admin { return 301 /admin/; } location ^~ /admin/ { proxy_pass http://127.0.0.1:9001/admin/; 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 = /snail-job { return 301 /snail-job/; } location ^~ /snail-job/ { proxy_pass http://127.0.0.1:9002/snail-job/; 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; } }