mirror of
https://github.com/umputun/reproxy.git
synced 2025-02-16 18:34:30 +02:00
send x-forwarded headers for ssl static mode as well
This commit is contained in:
parent
f573cd9e86
commit
631244671a
@ -157,7 +157,7 @@ In case if rules set as a part of docker compose environment, destination with t
|
|||||||
|
|
||||||
## SSL support
|
## SSL support
|
||||||
|
|
||||||
SSL mode (by default none) can be set to `auto` (ACME/LE certificates), `static` (existing certificate) or `none`. If `auto` turned on SSL certificate will be issued automatically for all discovered server names. User can override it by setting `--ssl.fqdn` value(s). In `auto` SSL mode, Reproxy will automatically add the `X-Forwarded-Proto` and `X-Forwarded-Port` headers. These headers are useful for services behind the proxy to know the original protocol (http or https) and port number used by the client.
|
SSL mode (by default none) can be set to `auto` (ACME/LE certificates), `static` (existing certificate) or `none`. If `auto` turned on SSL certificate will be issued automatically for all discovered server names. User can override it by setting `--ssl.fqdn` value(s). In `auto` and `static` SSL mode, Reproxy will automatically add the `X-Forwarded-Proto` and `X-Forwarded-Port` headers. These headers are useful for services behind the proxy to know the original protocol (http or https) and port number used by the client.
|
||||||
|
|
||||||
## Headers
|
## Headers
|
||||||
|
|
||||||
|
@ -212,7 +212,7 @@ func (h *Http) proxyHandler() http.HandlerFunc {
|
|||||||
uu := ctx.Value(ctxURL).(*url.URL)
|
uu := ctx.Value(ctxURL).(*url.URL)
|
||||||
keepHost := ctx.Value(ctxKeepHost).(bool)
|
keepHost := ctx.Value(ctxKeepHost).(bool)
|
||||||
r.Header.Add("X-Forwarded-Host", r.Host)
|
r.Header.Add("X-Forwarded-Host", r.Host)
|
||||||
if h.SSLConfig.SSLMode == SSLAuto {
|
if h.SSLConfig.SSLMode == SSLAuto || h.SSLConfig.SSLMode == SSLStatic {
|
||||||
r.Header.Add("X-Forwarded-Proto", "https")
|
r.Header.Add("X-Forwarded-Proto", "https")
|
||||||
r.Header.Add("X-Forwarded-Port", "443")
|
r.Header.Add("X-Forwarded-Port", "443")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user