mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-06 02:48:48 +03:00
fastcgi: Add HTTPS env variable on HTTPS connections
This commit is contained in:
parent
36fa6e857b
commit
8d81ae88da
1 changed files with 5 additions and 0 deletions
|
@ -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
|
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
|
// Add env variables from config
|
||||||
for _, envVar := range rule.EnvVars {
|
for _, envVar := range rule.EnvVars {
|
||||||
env[envVar[0]] = envVar[1]
|
env[envVar[0]] = envVar[1]
|
||||||
|
|
Loading…
Reference in a new issue