32 lines
1.1 KiB
Nginx Configuration File
32 lines
1.1 KiB
Nginx Configuration File
server {
|
|
listen 80;
|
|
|
|
client_max_body_size 20M;
|
|
|
|
gzip on;
|
|
gzip_min_length 1k;
|
|
gzip_comp_level 9;
|
|
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
|
|
gzip_vary on;
|
|
gzip_disable "MSIE [1-6]\.";
|
|
|
|
location / {
|
|
root /usr/share/nginx/html; # 前端构建文件的位置
|
|
index index.html index.htm;
|
|
try_files $uri $uri/ /index.html; # 支持前端路由
|
|
}
|
|
|
|
location /api { # 假设 API 路径是 /api
|
|
proxy_pass http://workflow-server:8080; # 将请求代理到 Sanic 服务
|
|
proxy_http_version 1.1;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
}
|
|
|
|
location /docs { # 假设 API 路径是 /api
|
|
proxy_pass http://workflow-server:8080/docs; # 将请求代理到 Sanic 服务
|
|
proxy_http_version 1.1;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
}
|
|
} |