[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Apache's strange behavior on Debian?

> I have multiple apache virtual namehosts configured on a single backend
> server, respectively named as serverA.local and serverB.local, then I have
> Apache reverse proxy configured to proxy these 2 namehosts also under 2
> virtual names hosts on proxy as below:

I fail to understand the picture completely. How many Apache
installations are you talking about? What I think you are doing is that
you have one or more servers on the backend (.local) and an additional
one on the frontend (*.com) which can access the .local ones.

> <VirtualHost *:443>
>   Servername serverA.com
>   ProxyRequests Off
>   ProxyPreserveHost On
>   ProxyPass / https://serverA.local
>   ProxyPassReverse / https://serverA.local/
>   SSLEngine on
>   ………
> </VirtualHost>


> <VirtualHost *:443>
>   Servername serverB.com
>   ProxyRequests Off
>   ProxyPreserveHost On
>   ProxyPass / https://serverB.local
>   ProxyPassReverse / https://serverB.local/
>   SSLEngine on
>   ………
> </VirtualHost>


> the interesting thing I see is if I go to https://serverB.com, I see
> https://serverA.com. But direct access to https://serverB.local and
> https://serverA.com from the reverse proxy are completed fine.

My advice is to always use one separate log file for each VirtualHost
section. Otherwise it is hard to debug which VirtualHost section is used
for a request by Apache. You can also use %v and %{Host}i to see the
ServerName of the selected VirtualHost and the Host header sent by the

> Somehow I
> have a feeling that when Apache is proxying to the backend, it directs to
> the "default server” on the backend, which in this serverA. Does anyone has
> the same experience or did I miss anything that is simply?

Ok, so both .local domains are served by the same Apache? Then configure
appropriate logging there as well.

The ProxyPreserveHost setting may be interesting to you as well, but I
don't think it will solve your immediate problem.

TFI Friday makes me feel very alone.
[Agree]   [Disagree]

Attachment: signature.asc
Description: Digital signature

Reply to: