This article comes from :http://blog.csdn.net/yl_wh/article/details/8697501

apache Medium mod_proxy The main function of the module is to url Forwarding , It has the function of agent . Apply this function , Can be very convenient to achieve the same tomcat And so on , Even it can be easily realized web The function of clustering .

For example, using apache As domain name www.test.com proxy server , Expose it to the public network , namely DNS To this machine , Really provide web The server is another machine on the same intranet , Suppose IP yes 192.168.100.22, Then you just need the following configuration .

ProxyPass / http://192.168.100.22/
ProxyPassReverse / http://192.168.100.22/

ProxyPass Well understood. , It's about putting all the clients on http://www.test.com Request forwarded to http://192.168.100.22 Top processing ,ProxyPassReverse The configuration of is always the same as ProxyPass Agreement , But the use is very confusing .

It seems to work well to get rid of it , Is this really the case , It's not , If there is... In the response 302 Redirect ,ProxyPassReverse It comes in handy .

Illustrate with examples , Suppose the user accesses http://www.test.com/exam.php, Forward it to http://192.168.100.22/exam.php Handle ,

Assume exam.php The result of processing is to implement redirect To login.php( Using relative paths , That is, the domain name information is omitted ), If the reverse proxy is not configured , The request response received by the client is a redirection operation , And redirect the purpose url by http://192.168.100.22/login.php , And this address is only accessible by proxy server , As one can imagine , The client can't be opened , On the contrary, if reverse proxy is configured , It will be transferred to HTTP The redirection is adjusted to the client before it is answered to the client http://www.test.com/login.php, That is, after the original request is added redirect The path of . When the client requests again http://www.test.com/login.php, The proxy server works again and forwards it to http://192.168.100.22/login.php.

【 turn 】Apache Configuration in progress ProxyPassReverse More about the meaning of directives

  1. apache Configuration in progress ProxyPassReverse The meaning of instruction

    apache Medium mod_proxy The main function of the module is to url Forwarding , It has the function of agent . Apply this function , Can be very convenient to achieve the same tomcat And so on , Even it can be easily realized web The function of clustering . For example, using ap ...

  2. Apache Configuration in progress ProxyPass And ProxyPassReverse And ProxyPassMatch Overview

    apache Medium mod_proxy The main function of the module is to url Forwarding , It has the function of agent . Apply this function , Can be very convenient to achieve the same tomcat And so on , Even it can be easily realized web The function of clustering . For example, using ap ...

  3. Apache The configuration of the ProxyPass and ProxyPassReverse

    apache Medium mod_proxy The module is used for url Forwarding , It has the function of agent . Apply this function , Can be very convenient to achieve the same tomcat And so on , Even it can be easily realized web The function of clustering . For example, using apache As ...

  4. apache kafka Configuration in progress request.required.acks meaning

    Kafka producer Of ack Yes 3 Medium mechanism , initialization producer At the time of the producerconfig Can be configured by request.required.acks Different values to achieve . 0: That means producers prod ...

  5. spring The meaning of related properties in configuration :

    1:parent Element attributes One bean The definition may contain a lot of configuration information , Include container related information ( For example, initialization methods , Static factory methods and so on ) And the values of constructor parameters and properties . One child bean A definition is one that can be derived from paren ...

  6. apache Small details in configuration

    configuration error: couldn’t perform authentication The wrong solution configuration error: couldn’t perform au ...

  7. apache To configure Options Detailed explanation

    http://www.365mini.com/page/apache-options-directive.htm Options Instruction is Apache Configuration file is a common and important instruction ,Options ...

  8. The requested URL / was not found on this server——Apache Unable to access after configuring the virtual domain name localhost

    Today, in order to do the project , stay Apache The project domain name is configured in , Successful visit . But suddenly I found that I wanted to visit localhost All of a sudden The requested URL / was not found on this server. ...

  9. wdlinux in apache Configure the reverse proxy module

    Want to be in .htaccess It doesn't work to turn on the reverse proxy function [apache There is no mod_proxy modular ] .htaccess The contents of the document are as follows RewriteEngine On RewriteBase / Rewri ...

Random recommendation

  1. Java The first 18 Chapter polymorphic

    18 Chapter   --> polymorphic Inherit : extends abstract class abstract ( Limit the instantiation of classes ) Abstract method public abstract void show(); // Abstract methods only have the declaration of methods , no ...

  2. C++ async task

    Doing in recently Android Development , Multithreading is used frequently ,java Multithreading interface is very convenient . Thread, AysncTask, Handler These interfaces are better than posix Provided pthread_create() etc. ...

  3. Lethal thunder dog --- WeChat development 62---- therefore memcache Yes access_token Global cache optimization

    The official account calls the interface is not unlimited. , To prevent WeChat server load exception from preventing official account errors , By default , Each official account can not exceed the limit of the interface. , When a certain limit is exceeded , Calling the corresponding interface will receive an error message , Causes the call to fail . We also ...

  4. Team Homework #2 Decide the roles of each team member ——IloveSE

    Hello everyone , We are IloveSEers! Xu Shan , I am a cheerful person , But girls who think computers are boring . After two years of study , Own programming ability , It's not very strong , More practice is needed here . For the course of software engineering , I am full of expectation , Because I'm not only ...

  5. web System

    current web The system has been more and more application of cache technology , And caching technology can really enhance the performance of the system . I also began to contact some caching requirements in the project . It's easy to start with jvm(java Managed memory ) To do caching , So for a single application server ...

  6. Matlab in K-means The use of clustering algorithms (K- Mean clustering )

    K-means The clustering algorithm is based on N*P Matrix X Divided into K Classes , To maximize the distance between objects in a class , The distance between classes is the smallest . Usage method :Idx=Kmeans(X,K)[Idx,C]=Kmeans(X,K) [Idx, ...

  7. shell Programming if...else case...esac

    shell There are three kinds of conditional sentences if...fi   sentence if...else...fi   sentence if...elif...fi   sentence Example : a=10; b=20; if [ $a -gt %b ] t ...

  8. One a day linux command (1):wc command

    Linux In the system wc(Word Count) The function of the command is to count the number of bytes in the specified file . Number of words . Row number , And display the statistical results . 1. Command format : wc [ Options ] file ... 2. Command function : Count the number of bytes in the specified file . ...

  9. Eclipse stay Debug I often enter ThreadPoolExecutor terms of settlement

    1. Get into Window--> Search for :debug

  10. RF Use ie Browser access page , Browser startup only shows This is the initial start page for the WebDriver server, Page access failed

    Problem description : start-up ie Behind the browser , The page is as follows : Problem location : 1.IE Page zoom is not set to 100% 2.ie Whether the browser's security mode settings will “ Start protected mode ” Check on 3.iedriver Whether the driver version number and seleni ...