Apache Configure Proxy Server (forward proxy, reverse proxy)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.