1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# http协议虚拟主机的配置文件模板
# vim /usr/local/nginx/conf/vhosts/test.com.conf
upstream
test
.com {
server 1.1.1.1:81 max_fails=3 fail_timeout=60s;
server 2.2.2.2:81 max_fails=3 fail_timeout=60s;
ip_hash;
}
server {
listen 80;
server_name
test
.com;
location / {
root html;
index index.html index.htm;
proxy_pass http:
//test
.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
access_log
/data0/log/nginx/test
.com.log nginx_log;
}
}
|
本文转自 wpf926 51CTO博客,原文链接:http://blog.51cto.com/wupengfei/1958141,如需转载请自行联系原作者