Apache/Varinish redirecting mydomain.com/folder to mydomain.com:8080/folder/

August 22, 2014 1.1k views

I've set up Apache/Varnish but when I try to access a folder on the domain, such as mydomain.com/whatever it is redirecting to mydomain.com:8080/whatever/ and I'm getting a page not available. However when I access mydomain.com/whatever/ with a trailing "/" at the end everything works fine. I'm pretty new to Varnish so any help troubleshooting would be appreciated.

1 Answer

Is Apache listening on 8080 publicly? Usually the way to do it is have Apache listening on the local loopback device. What's the Varnish backend configuration?

backend default {
    .host = "";
    .port = "8080";

In /etc/apache2/ports.conf you should set Apache to listen locally:


And your VirtualHost should look like:

Have another answer? Share your knowledge.