nginx超时配置

#项目
server {
listen 81;
server_name X.XXX.XXX.XX;
location / {
root /gds/xxx/dist/;
try_files $uri $uri/ @router;
index index.html index.htm;
}
location ~ ^/(images|img|javascript|js|css|flash|media|static|cdn)/ {
root /gds/nmg/dist/;
}
location ^~/api/ {
proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
proxy_pass http://172.0.0.1:8080/;
proxy_set_header x-forwarded-for $remote_addr;
}
location @router {
rewrite ^.*$ /index.html last;
}
}

posted @ 2022-06-09 17:05  全琪俊  阅读(189)  评论(0编辑  收藏  举报