问下nginx配置转发的问题?
我在一个服务器上,配置了伪静态
location / {
index index.html index.htm index.php;
#autoindex on;
try_files $uri $uri/ /index.php$is_args$query_string;
}
然后我想在这个服务器做一个转发。
location /api/newweb{
proxy_pass https://test.com:8080/api/newweb;
break;
}
我想当请求 /api/newweb 开头时候能转发到另一个端口上,这应该怎么配置的呢?
然后不知为什么我加了这个配置后,就不能转发了,我应该怎么既能加上下面的配置又能转发呢?
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
推荐文章: