Mailing List Archive

Fwd: Dont understand how to implement this FAQ topic
I don't understand the this FAQ topic
<https://github.com/varnish/hitch/wiki/FAQ#redirect-varnish-http-clients-to-https>
.

I want to implement it. In my /etc/varnish/default.vcl I have this:

backend apache {
.host = "127.0.0.1";
.port = "5555";
}

backend node_hello {
.host = "127.0.0.1";
.port = "5556";
}

import std;

sub vcl_recv {
# Happens before we check if we have this in cache already.
#
# Typically you clean up the request here, removing cookies you don't need,
# rewriting the request, etc.

if ((std.port(local.ip) == 6086) && (std.port(server.ip) == 443)) {
set req.http.X-Forwarded-Proto = "https";
}

if(req.http.host ~ "domain1.com") {
set req.backend_hint = apache;
}
elsif(req.http.host == "domain2.com") {
set req.backend_hint = node_hello;
}
}

How should my implementation become?