29 lines
684 B
Plaintext
29 lines
684 B
Plaintext
|
|
# 在http区域内一定要添加下面配置, 支持websocket
|
|
map $http_upgrade $connection_upgrade {
|
|
default upgrade;
|
|
'' close;
|
|
}
|
|
|
|
server {
|
|
gzip on;
|
|
gzip_comp_level 2;
|
|
gzip_min_length 1000;
|
|
gzip_types text/xml text/css;
|
|
gzip_http_version 1.1;
|
|
gzip_vary on;
|
|
gzip_disable "MSIE [4-6] \.";
|
|
|
|
listen 8443;
|
|
location /api {
|
|
proxy_pass http://backend:7860;
|
|
proxy_read_timeout 300s;
|
|
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_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection $connection_upgrade;
|
|
client_max_body_size 50m;
|
|
}
|
|
} |