[英]nginx location can't have both rewrite and proxy
location = /land { 位置= /土地{
proxy_pass http://172.0.0.78:3033;
if ($http_user_agent ~* "(Android|iPhone|iPod|Symbian|BlackBerry|Windows Phone|Mobile|J2ME)") {
root /home/xxx/;
rewrite /(.*) /index.html;
break;
}
} }
Excuse me, where is the above problem? 请问以上问题在哪里? How should I modify it?
我应该如何修改?
thks~ ~~
It's always wise to separate proxied and static content: 分隔代理内容和静态内容总是明智的:
location = /land {
if ($http_user_agent ~* "(Android|iPhone|iPod|Symbian|BlackBerry|Windows Phone|Mobile|J2ME)") {
rewrite ^ /index.html last;
}
proxy_pass http://172.0.0.78:3033;
}
location = /index.html {
root /home/xxx/;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.