nginx配置的一些细节
第一种方式
server {
listen 80;
server_name wan.www.cn;
#access_log logs/nnnnnnnnnnnnn.log main;
root D:/pc/dist/ssb;
index index.php index.html index.htm;
location /huomao/ {
proxy_pass http://www.huomao.com/; #带了符号/
proxy_set_header Host $host;
}
访问方式是
http://wan.www.cn/huomao/get/user
代理后的路径
http://www.huomao.com/get/user
第二种方式
server {
listen 80;
server_name wan.www.cn;
#access_log logs/nnnnnnnnnnnnn.log main;
root D:/pc/dist/ssb;
index index.php index.html index.htm;
location /huomao/ {
proxy_pass http://www.huomao.com; #没有带符号/
proxy_set_header Host $host;
}
访问方式是
http://wan.www.cn/huomao/get/user
代理后的路径
http://www.huomao.com/huomao/get/user