动不动就拔网线、封机房;现在更厉害的一招,从网关封杀你的80端口,一旦被封,网站域名就无法访问;
以上便废话,下面转入正题,其它就不帖了,直接给代码,利用nginx的反向代理功能,一般大家都很看懂,也不多记录了;
[code]
server {
listen 80;
server_name zzvips.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
access_log off;
location / {
proxy_pass http://192.168.1.100:81;
}
}
server {
listen 80;
server_name www.zzvips.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
access_log off;
location / {
proxy_pass http://www.baidu.com:8080;
}
}
[html]