反向代理设置:
server {
listen 80 default_server; #监听端口
root /mnt/aa; #访问根目录
index index.html index.htm; #默认页,可以不设置
server_name www.yanyusun.com; #根据域名跳转
location / {
try_files $uri $uri/ =404;
proxy_pass http://127.0.0.1:8081; #跳转的路径
}
}
server {
listen 80;#监听端口
root /mnt/bb;
index index.html index.htm;
server_name bs.yanyusun.com;
location / {
try_files $uri $uri/ =404;
proxy_pass http://127.0.0.1:8082; #另一个路径
}
}