You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Florian Schwalm <fl...@flo-films.de> on 2021/03/16 20:35:19 UTC

[users@httpd] Aw: Re: [users@httpd] Apache Reverse Proxy for more than one website.

No, you can only have one virtual host per port.  
Either you make the second server accessible on a different port or you
separate them by server name (namebased virtual hosts) or path... Either way
you'd need to decide how you want to distinguish from the user's point of view
which server the request is for.  

Am 16.03.21, 21:23 schrieb Jason Long <ha...@yahoo.com.INVALID>:

> Thanks.  
>  Thus, I can one .conf file under the "/etc/httpd/conf.d/" directory with
some servers. For example,  
>  
>  #Server 1  
>  <VirtualHost *:80>  
>          ProxyPreserveHost On  
>          ProxyPass / <http://192.168.1.4/>  
>          ProxyPassReverse / <http://192.168.1.4/>  
>  </VirtualHost>  
>  
>  #Server 2  
>  <VirtualHost *:80>  
>          ProxyPreserveHost On  
>          ProxyPass / <http://192.168.1>./  
>          ProxyPassReverse / <http://192.168.1.5/>  
>  </VirtualHost>  
>  
>  
>  
>  
>  Am I right?  
>  
>  
>  On Tuesday, March 16, 2021, 10:01:27 PM GMT+3:30, Antony Stone
<an...@apache.open.source.it> wrote:  
>  
>  
>  
>  
>  
>  On Tuesday 16 March 2021 at 19:16:56, Jason Long wrote:  
>  
>  > Hello,  
>  > For a website, I created a reverse proxy config file under the  
>  > "/etc/httpd/conf.d/" directory as below:  
>  >  
>  > <VirtualHost *:80>  
>  >        ProxyPreserveHost On  
>  >        ProxyPass / <http://192.168.1.4/>  
>  >        ProxyPassReverse / <http://192.168.1.4/>  
>  > </VirtualHost>  
>  >  
>  > If I have other servers, then I must create a config file for each of
them  
>  > or I just need to add my servers IP addresses to the above file?  
>  
>  You can put all your configurations into one file, that is not a problem.  
>  
>  You will need a completely separate <VirtualHost> section for each machine
you  
>  want to act as a reverse proxy for.  
>  
>  Finally, I trust you realise that you cannot use <VirtualHost *:80> with
more  
>  than one back-end server - there needs to be a way to distinguish which  
>  incoming requests are to be passed to server A and which ones to server B
etc  
>  (in other words, you have to change the * to something which identifies
what  
>  you want to reverse proxy to where).  
>  
>  
>  Antony.  
>  
>  \--  
>  In Heaven, the beer is Belgian, the chefs are Italian, the supermarkets are  
>  British, the mechanics are German, the lovers are French, the entertainment
is  
>  American, and everything is organised by the Swiss.  
>  
>  In Hell, the beer is American, the chefs are British, the supermarkets are  
>  German, the mechanics are French, the lovers are Swiss, the entertainment
is  
>  Belgian, and everything is organised by the Italians.  
>  
>                                                    Please reply to the list;  
>                                                          please *don't* CC
me.  
>  
>  
>  \---------------------------------------------------------------------  
>  To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org  
>  For additional commands, e-mail: users-help@httpd.apache.org  
>  
>  
>  \---------------------------------------------------------------------  
>  To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org  
>  For additional commands, e-mail: users-help@httpd.apache.org  
>  
>

\--------------------------------------------------------------------- To
unsubscribe, e-mail: users-unsubscribe@httpd.apache.org For additional
commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Aw: Re: [users@httpd] Apache Reverse Proxy for more than one website.

Posted by Jason Long <ha...@yahoo.com.INVALID>.
Thus, for each server I need a config file?






On Wednesday, March 17, 2021, 12:12:09 AM GMT+3:30, Florian Schwalm <fl...@flo-films.de> wrote: 





No, you can only have one virtual host per port.
Either you make the second server accessible on a different port or you separate them by server name (namebased virtual hosts) or path... Either way you'd need to decide how you want to distinguish from the user's point of view which server the request is for.

Am 16.03.21, 21:23 schrieb Jason Long <ha...@yahoo.com.INVALID>:
>  Thanks. 
> Thus, I can one .conf file under the "/etc/httpd/conf.d/" directory with some servers. For example, 
> 
> #Server 1 
> <VirtualHost *:80> 
>         ProxyPreserveHost On 
>         ProxyPass / http://192.168.1.4/ 
>         ProxyPassReverse / http://192.168.1.4/ 
> </VirtualHost> 
> 
> #Server 2 
> <VirtualHost *:80> 
>         ProxyPreserveHost On 
>         ProxyPass / http://192.168.1./ 
>         ProxyPassReverse / http://192.168.1.5/ 
> </VirtualHost> 
> 
> 
> 
> 
> Am I right? 
> 
> 
> On Tuesday, March 16, 2021, 10:01:27 PM GMT+3:30, Antony Stone <an...@apache.open.source.it> wrote: 
> 
> 
> 
> 
> 
> On Tuesday 16 March 2021 at 19:16:56, Jason Long wrote: 
> 
>> Hello, 
>> For a website, I created a reverse proxy config file under the 
>> "/etc/httpd/conf.d/" directory as below: 
>> 
>> <VirtualHost *:80> 
>>        ProxyPreserveHost On 
>>        ProxyPass / http://192.168.1.4/ 
>>        ProxyPassReverse / http://192.168.1.4/ 
>> </VirtualHost> 
>> 
>> If I have other servers, then I must create a config file for each of them 
>> or I just need to add my servers IP addresses to the above file? 
> 
> You can put all your configurations into one file, that is not a problem. 
> 
> You will need a completely separate <VirtualHost> section for each machine you 
> want to act as a reverse proxy for. 
> 
> Finally, I trust you realise that you cannot use <VirtualHost *:80> with more 
> than one back-end server - there needs to be a way to distinguish which 
> incoming requests are to be passed to server A and which ones to server B etc 
> (in other words, you have to change the * to something which identifies what 
> you want to reverse proxy to where). 
> 
> 
> Antony. 
> 
> -- 
> In Heaven, the beer is Belgian, the chefs are Italian, the supermarkets are 
> British, the mechanics are German, the lovers are French, the entertainment is 
> American, and everything is organised by the Swiss. 
> 
> In Hell, the beer is American, the chefs are British, the supermarkets are 
> German, the mechanics are French, the lovers are Swiss, the entertainment is 
> Belgian, and everything is organised by the Italians. 
> 
>                                                   Please reply to the list; 
>                                                         please *don't* CC me. 
> 
> 
> --------------------------------------------------------------------- 
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org 
> For additional commands, e-mail: users-help@httpd.apache.org 
> 
> 
> --------------------------------------------------------------------- 
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org 
> For additional commands, e-mail: users-help@httpd.apache.org 
> 
> 
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org