The main function of the Mod_proxy module in Apache is to forward the URL, which is the function of the agent. With this feature, it is convenient to realize the integration with the application server such as Tomcat, which can easily realize the function of the Web cluster.
For example, using Apache as the domain name www.test.com Proxy Server, exposing it to the public network, that is, DNS resolution to this machine, the real Web server is another one located in the same intranet machine, assuming the IP is 192.168.100.22, then only need the following configuration is possible.
proxypass/http://192.168.100.22/
proxypassreverse/http://192.168.100.22/
Proxypass is well understood, that is, all requests from the client to http://www.test.com are forwarded to the http://192.168.100.22 for processing, proxypassreverse configuration is always consistent with Proxypass , but the use is puzzling. Seems to get rid of it is very good work, the fact is true, actually, if there are 302 redirects in response, Proxypassreverse will come in handy. For example, suppose the user accesses the http://www.test.com/exam.php and forwards it to http://192.168.100.22/ exam.php processing, assuming that the result of exam.php processing is to implement redirect to login.php (using relative paths, that is, omitting the domain name information), if the reverse proxy is not configured, the client receives a request response that is a redirect operation, and the redirect destination URL is http:/ /192.168.100.22/login.php, and this address is only the proxy server can be accessed, it is conceivable that the client is not open, and conversely if the reverse proxy is configured, it will be transferred to the HTTP redirect before forwarding to the client. Www.test.com/login.php, which is the redirect path appended to the original request. When the client requests http://www.test.com/login.php again, the proxy server works again to forward it to http://192.168.100.22/login.php.
The client-to-server is called a forward proxy, and the server to the client is called a reverse proxy.
The above describes the Apache configuration of the meaning of the Proxypassreverse directive, including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.