注意:vhost下面的配置文件,一定是以 .conf 结束,并且要刷新nginx ../../sbin -s reload
我配置的时候就遇到一个坑,就是没有以这个结束,导致配置以后一直不生效
图片中箭头的地方也要注意,一定要严格按照这个格式,最后要有/ ,不然也不会成功。
![](https://img.haomeiwen.com/i13338396/194ad766339630cd.png)
server {
listen 80;
server_name oa.*****.com;
location / {
proxy_pass http://127.0.0.1:8802;
#root /usr/html/html-back;
#index index.html index.htm;
}
location /manage {
alias /usr/html/html-front;
index index.html index.htm;
}
location /warehouse/ {
proxy_pass http://127.0.0.1:8802/;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
网友评论