# 环境Liunx、Vue #
此配置使用于前端增加api路由转发,也就是Vue里配置的路由跳转用/api/
location /api/ {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://172.26.67.53:8099/;
}
此配置适用于后端增加api路径,也就是controller里配置的前端请求路径用/api
location /api {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://172.26.67.53:8099;
}
# 配置nginx上传文件大小限制,超时时间
#
client_max_body_size 15m;
client_body_buffer_size 15m;
# 超时时间
proxy_connect_timeout 120s;
proxy_send_timeout 120s;
proxy_read_timeout 120s;