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?
_______________________________________________
varnish-misc mailing list
varnish-misc@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Reply via email to