Apache/Nginx/Squid反向代理简单设置

1.Apache简单设置

访问http://ncist.rayyn.net得到http://ncistbbs.rayyn.net的内容

LoadModule proxy_module modules/mod_proxy.so
<VirtualHost *:80>
ServerName ncist.rayyn.net
ServerAlias ncist6.rayyn.net bbs.ncist.edu.cn
ProxyPass / http://ncistbbs.rayyn.net/
ProxyPassReverse / http://ncistbbs.rayyn.net/
</VirtualHost>

2.Nginx简单设置

server
{
listen 80;
server_name ncist.rayyn.net;

location / {
proxy_pass http://ncistbbs.rayyn.net/;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}

3.Squid简单设置

http_port 80 vhost

cache_peer 10.1.0.99 parent 80 0 no-query originserver name=bbs

acl all src 0.0.0.0/0.0.0.0
http_access allow all
cache_peer_access bbs allow all

This entry was posted in 网络相关 and tagged , , , , . Bookmark the permalink.

发表评论

电子邮件地址不会被公开。 必填项已用*标注