Forward proxies and reverse proxies are named from the data flow direction, forward proxies, proxy user requests, reverse proxies, alternate server accept requests
Forward Proxy: User-"proxy server-" WWW user request data to the proxy server, proxy server to help users go to WWW request data, and then return to the user
Role: Configure the proxy server, clients do proxy settings can access Facebook,twitter
How to configure:
<virtualhost *:80> /home/web ServerName www. xxx. com serveralias xxx. com " logs/zx_xxx.com-error.log " " Logs/zx_xxx.com-access.log "common <directory"/home /web "> Options Indexes followsymlinks allowoverride None Require all Granted </Directory> proxyrequests on proxyvia on <proxy *> Order Deny,allow allow from all </Proxy> </VirtualHost>
First set up a virtual host, and then in the inside to configure the red command, Red flag is configured to configure the forward proxy instructions
Proxyrequests on means to turn on forward proxy
Proxyvia on modifying header data headers, marking
Reverse proxy: User "-Proxy server"-www.xxx.xxx XXX Website The root server is not directly receiving the user's request, but instead receives the request through its own proxy server and forwards it to itself.
Role: If you use your own domain name www.xxx.xxx configured www.baidu.com reverse proxy, then you access www.xxx.xxx equivalent to access www.baidu.com (Google needs to configure the SSL proxy)
Configuration:
# ########## #反向代理 <virtualhost *:80> DocumentRoot " d:/www/test " ServerName www . xxx. com serveralias xxx . com errorlog "Logs/fx_xxx.com-error.log" Customlog "Logs/fx_quduoqi.com-access.log" common <directory "d:/ Www/test "> Options followsymlinks allowoverride all Order Allow,deny allow from all </Directory> # reverse proxy settings proxypass/http:// www.baidu.com/ProxyPassReverse/http://www.baidu.com/ </virtualhost>
The same forward proxy is configured with a virtual host and then the reverse proxy directive is configured
proxypass/http://www.baidu.com/
proxypassreverse/http://www.baidu.com/ Replace the URL in the returned page if there are www.baidu.com/xx/xx in the page replaced WWW.XXX.XXX/XX/XX
My Apache is 2.4.6 for reference only
Reference:
Http://www.cnblogs.com/zemliu/archive/2012/04/18/2454655.html
Http://baike.baidu.com/view/1165595.htm
Http://baike.baidu.com/view/751.htm
Apache Configure Proxy Server (forward proxy, reverse proxy)