diff options
author | Mark Felder <feld@FreeBSD.org> | 2020-09-30 12:32:54 -0500 |
---|---|---|
committer | Mark Felder <feld@FreeBSD.org> | 2020-09-30 12:32:54 -0500 |
commit | 49229107e812d649e66e36e32e238db66b353b0f (patch) | |
tree | 1419ea0c659790a4cf9ea6c119fd97d4c55fe5e2 | |
parent | cee1883b35b5453782bea1e34ff9cbf1bde52f7c (diff) | |
download | pleroma-49229107e812d649e66e36e32e238db66b353b0f.tar.gz |
Make it possible for Varnish logs to contain the true scheme used by clients
instead of always reporting http://
-rw-r--r-- | installation/pleroma.vcl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/installation/pleroma.vcl b/installation/pleroma.vcl index 154747aa6..57b6d17b3 100644 --- a/installation/pleroma.vcl +++ b/installation/pleroma.vcl @@ -1,3 +1,4 @@ +# 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; @@ -14,8 +15,11 @@ acl purge { 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 |