mirror of
https://github.com/caddyserver/caddy.git
synced 2025-07-09 03:04:57 -04:00
fastcgi: Add HTTPS env variable on HTTPS connections
This commit is contained in:
parent
36fa6e857b
commit
8d81ae88da
@ -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…
x
Reference in New Issue
Block a user