fastcgi: Add HTTPS env variable on HTTPS connections

This commit is contained in:
Matthew Holt 2015-08-03 17:16:24 -06:00
parent 36fa6e857b
commit 8d81ae88da

View file

@ -204,6 +204,11 @@ func (h Handler) buildEnv(r *http.Request, rule Rule, fpath string) (map[string]
env["PATH_TRANSLATED"] = filepath.Join(h.AbsRoot, pathInfo) // Info: http://www.oreilly.com/openbook/cgi/ch02_04.html
}
// Some web apps rely on knowing HTTPS or not
if r.TLS != nil {
env["HTTPS"] = "on"
}
// Add env variables from config
for _, envVar := range rule.EnvVars {
env[envVar[0]] = envVar[1]