以上便废话,下面转入正题,其它就不帖了,直接给代码,利用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]
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)