Artyum
Artyum

Reputation: 103

Using Varnish only as a Reverse Proxy without caching

I'd like to know what can I put in my VCL to tell Varnish to not cache the requests and pass all the requests to the backend, because I would like to use Varnish as a reverse proxy to hide the actual IP of my backends. I did some researches but I didn't find anything concrete. I'm using Varnish 3 and my actual Varnish VCl is:

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

Thank you.

Upvotes: 0

Views: 758

Answers (2)

Brian van Rooijen
Brian van Rooijen

Reputation: 2016

if you want varnish to do nothing with the request at all you should use pipe. This prevents varnish from rewriting the headers. The response is sent back from varnish directly.

sub vcl_recv {
    return(pipe);
}

Upvotes: 2

Marcel Dumont
Marcel Dumont

Reputation: 1207

You'll need to overwrite the default handling to force a 'pass'

This in both vcl_recv and vcl_fetch

sub vcl_recv { pass; }

sub vcl_fetch { pass; }

Upvotes: -1

Related Questions