整理了Nginx的一些相關(guān)配置尖飞,有需要配置的時(shí)候可以方便查看一下
1植捎、使用同一個(gè)端口配置多個(gè)站點(diǎn)
server {
listen 8080;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
#加下面的配置
location /baidu{
proxy_pass http://localhost:8081/bob/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 100m;
root html;
index index.html index.htm;
}
location /taobao{
proxy_pass http://localhost:8082/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 100m;
root html;
index index.html index.htm;
}
}
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者