add x-forwarded-proto
This commit is contained in:
parent
907d7e574b
commit
828d2300c0
3 changed files with 96 additions and 86 deletions
|
|
@ -49,6 +49,7 @@ pub(super) fn append_header_entry(
|
|||
pub(super) fn add_forwarding_header(
|
||||
headers: &mut HeaderMap,
|
||||
client_addr: SocketAddr,
|
||||
tls: bool,
|
||||
) -> Result<()> {
|
||||
// default process
|
||||
// optional process defined by upstream_option is applied in fn apply_upstream_options
|
||||
|
|
@ -57,6 +58,11 @@ pub(super) fn add_forwarding_header(
|
|||
"x-forwarded-for",
|
||||
&client_addr.to_canonical().ip().to_string(),
|
||||
)?;
|
||||
append_header_entry(
|
||||
headers,
|
||||
"x-forwarded-proto",
|
||||
if tls { "https" } else { "http" },
|
||||
)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue