以上便废话,下面转入正题,其它就不帖了,直接给代码,利用nginx的反向代理功能,一般大家都很看懂,也不多记录了;
[code]
server {
listen 80;
server_name a.jb51.net;
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 b.jb51.net;
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]
本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!