instead of always reporting http://
+# Recommended varnishncsa logging format: '%h %l %u %t "%m %{X-Forwarded-Proto}i://%{Host}i%U%q %H" %s %b "%{Referer}i" "%{User-agent}i"'
vcl 4.1;
import std;
sub vcl_recv {
# Redirect HTTP to HTTPS
if (std.port(server.ip) != 443) {
+ set req.http.X-Forwarded-Proto = "http";
set req.http.x-redir = "https://" + req.http.host + req.url;
return (synth(750, ""));
+ } else {
+ set req.http.X-Forwarded-Proto = "https";
}
# CHUNKED SUPPORT