通过域名来区分
#files.xiaoxinseo.com
server {
listen 80;
server_name files.xiaoxinseo.com;
location / {
root pdfFile;
index index.html index.htm;
}
error_page 500 502 503 504 http://files.xiaoxinseo.com/404.html;
location = /404.html {
root pdfFile;
}
}
反向代理的配置
upstream sina{
server 192.168.228.128:3000
}
server {
listen 80;
server_name msg.xiaoxinseo.com;
location / {
proxy_pass http://sina
index index.html index.htm;
}
}
重新启动
./nginx -s reload