0
点赞
收藏
分享

微信扫一扫

VUE项目的API项目的nginx配置

清冷的蓝天天 2023-01-11 阅读 126


#PROXY-START/api
location /api
{
expires 12h;
if ($request_uri ~* "(php|jsp|cgi|asp|aspx)")
{
expires 0;
}
proxy_pass http://c3w.cc;
proxy_set_header Host c3w.cc;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;

#持久化连接相关配置
#proxy_connect_timeout 30s;
#proxy_read_timeout 86400s;
#proxy_send_timeout 30s;
#proxy_http_version 1.1;
#proxy_set_header Upgrade $http_upgrade;
#proxy_set_header Connection "upgrade";
add_header X-Cache $upstream_cache_status;

#Set Nginx Cache

add_header Cache-Control no-cache;
}

#PROXY-END/api


# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }

location / {
try_files $uri $uri/ /index.html$is_args$query_string;
}

反向代理

 

vue的地址模式

举报

相关推荐

0 条评论