wtuyss 发表于 2016-12-24 10:26:41

nginx location规则替换

server {
listen       80;
server_namewww.6dgame.com 6dgame.com;
location /2013/ {
proxy_pass http://127.0.0.1:8081/;
}
location / {
proxy_pass http://127.0.0.1:8080/;
}
error_page   500 502 503 504/50x.html;
location = /50x.html {
root   html;
}
}
  
对于此种设置方法,

访问:http://54.200.150.182:8081/2013/和http://54.200.150.182/2013/2013是等效的。

也就是说访问http://54.200.150.182/2013/根据nginx配置会自动替换成http://54.200.150.182:8081
页: [1]
查看完整版本: nginx location规则替换