Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I've setup Varnish as a reverse proxy on port 80 before Apache 2.2.22 + VirtualHosts on port 81.

When I enter my websites from port 81 it's all ok, then when I try to enter from port 80 I got Apache2 Test Page.

I'm running only one backend (all on the same machine).

What should I add to my Varnish config to support all Apache VirtualHosts ? I would like to have such universal rule that will add all new domains without having to change my Varnish config each time.

On Lighttpd + virtual hosts everything was running out of a box.

share|improve this question

1 Answer 1

Check VirtualHost configuration, probably your vhost is configured only for *:81 but should be for *:80 too.

share|improve this answer
    
Shouldn't they all be on port 81 ? I think I need to change NameVirtualHost external IP to 127.0.0.1:81 –  Spacedust Mar 7 '12 at 23:28
    
I found a solution - Varnish was looking for webserver at 127.0.0.1, so the only possible way to fix this is to change virtualhosts to 127.0.0.1 or change Varnish to external IP. –  Spacedust Mar 7 '12 at 23:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.