WindowsStarter/base/Resources/nginx/conf/home-windows.conf
2025-08-20 16:00:41 +08:00

89 lines
2.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

upstream portal {
server 127.0.0.1:18880;
keepalive 32;
}
server {
listen 18080;
server_name _;
root html;
error_page 404 /404.html;
error_page 500 /50x.html?error=500;
error_page 502 /50x.html?error=502;
error_page 503 /50x.html?error=503;
error_page 504 /50x.html?error=504;
gzip on;
gzip_min_length 1k;
gzip_comp_level 9;
gzip_types text/plain text/css text/javascript application/json application/javascript application/x-javascript application/xml;
gzip_vary on;
gzip_disable "MSIE [1-6]\.";
# 传递用户请求的原始Host域名或IP+端口)
# proxy_set_header Host $host;
proxy_set_header Host $http_host;
# 传递用户真实IP
proxy_set_header X-Real-IP $remote_addr;
# 传递真实IP包含整个代理链路的IP信息
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# 传递用户请求的原始协议 (http 或 https)
proxy_set_header X-Forwarded-Proto $scheme;
# 用户原始的Cookie等完整请求头
proxy_set_header Cookie $http_cookie;
add_header X-Content-Type-Options "nosniff";
add_header X-Frame-Options "SAMEORIGIN";
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_read_timeout 10s;
proxy_connect_timeout 5s;
proxy_send_timeout 10s;
proxy_buffering off;
location = / {
rewrite ^ /home permanent;
}
location = /404.html {
root html;
internal;
}
location = /50x.html {
root /usr/share/nginx/html;
internal;
proxy_set_header X-Original-URI $request_uri;
proxy_set_header X-Real-IP $remote_addr;
}
location / {
proxy_pass http://portal/;
proxy_intercept_errors on;
}
location /assets/ {
proxy_pass http://portal/assets/;
expires 30d;
access_log off;
proxy_intercept_errors on;
}
location /api/ {
proxy_pass http://portal/api/;
client_max_body_size 100M;
proxy_intercept_errors on;
}
location /dev-api/ {
proxy_pass http://portal/dev-api/;
client_max_body_size 100M;
proxy_intercept_errors on;
}
}