问题描述
一台nginx反向代理,有2个location 代理不同的地址,有一台是静态页面代理,做完之后一台的访问不了
问题出现的平台版本及自己尝试过哪些方法
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)
server {
listen 8800;
server_name localhost;
location /rms{
root html;
index index.html index.htm;
add_header 'Access-Control-Allow-Origin' '*';
add_header Access-Control-Allow-Methods GET,POST,OPTIONS,DELETE;
add_header 'Access-Control-Allow-Headers' 'userId,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
proxy_pass http://9.1.8.249:8082/rms ;
}
location /rizhiyi/ {
root html;
alias /;
index index.html index.htm;
proxy_pass http://9.1.8.76/;
}
location ~* ^/(rizhiyi|images|img|javascript|js|css|blog|flash|media|static|api|auth|account|ico)/ {
proxy_pass http://9.1.8.76:80;
}
因为location /rizhiyi/段有静态页面所以我要加上这一段location ~* 但是加上这一段上面的location /rms 段就无法访问了。
你期待的结果是什么?实际看到的错误信息又是什么?
希望高手帮帮我。抱拳了。