The concept of forward agent
The forward agent, the legendary agent, works like a springboard,
To put it simply,
I'm a user, I can't access a website, but I can access a proxy server
This proxy server, he can access the site that I can not access
So I first connected to the proxy server and told him that I needed the content that could not access the site
Proxy server to fetch it back and then return to me
From the point of view of the website, there is only one record when the proxy server comes to fetch the content
Sometimes do not know is the user's request, also hides the user's information, depending on the agent does not tell the website
The conclusion is that the forward proxy is a server between the client and the original server (Origin server), in order to get content from the original server, the client sends a request to the agent and specifies the target (the original server), and then the agent forwards the request to the original server and returns the contents to the client. The client must make some special settings to use the forward proxy.
Enable Apache proxy module
A2enmod Proxy
A2enmod proxy_http
Configuring forward proxies is simple, just add your Apache-configured Vhost host to the browser's proxy option
1.1 Apache Configuration httpd-vhosts.conf (for example, under Windows)
<virtualhost *:80>
ServerAdmin prograsliu@gmail.com
documentroot "D:/www/test"
ServerName www.test.com
serveralias test.com
ErrorLog "Logs/test.com-error.log"
Customlog Test.com-access.log "Common
alias/sublook" d:/www/test/look/sublook/
<directory "D:/www/test" >
Options followsymlinks
allowoverride all order
allow,deny
allow
</Directory>
#正向代理设置
Proxyrequests on
Proxyvia on
<proxy *> order
Deny,allow
deny to all
allow from 127.0.0.1
</Proxy>
</VirtualHost>
Now look forward to the proxy set that section
Proxyrequests on: Open Apache forward Proxy
Proxyvia on: Controls the flow of proxy requests that reside in the chain of proxy servers
References to Proxyvia in the official Apache2.2 document are as follows:
1. If set to the default value off, special handling will not be taken. If a request or answer contains a "via:" header, it will be passed without any modification.
2. If set to on each request and answer will get a "Via:" header on the former host.
3. If set to full, each generated "via:" header will be added to the Apache server version, the "via:" annotation field appears.
4. If set to block, all the "Via:" header lines in each agent request will be deleted. and will not produce a new "Via:" header.
<proxy *>...</proxy>: To control who can access your agent
<proxy *> order
Deny,allow
deny to all
allow from 127.0.0.1
</Proxy>
This is set to this machine can use the agent, when the real use of the set up their own
1.2 Browser settings (for example, Firefox)