标签:nginx
最近测试怎么在nginx 中通过固定IP来访问某个地址,话不多说直接上代码:
location ^~ / { if ($request_uri ~ /) { set $bucketid $1; } if ($remote_addr ~* "192.168.114.146|192.168.114.145|192.168.114.144|192.168.11.51|192.168.11.125|192.168.58.3|192.168.11.42") { proxy_pass http://192.168.113.168:9085$1; } if ($remote_addr ~* "192.168.11.64") { proxy_pass http://192.168.113.167:9085$1; } include proxy.conf; access_log logs/web.log main; }
nginx location if 中使用proxy_pass
标签:nginx
原文地址:http://liuyusheng.blog.51cto.com/10570745/1770622