parent
f53a270a00
commit
3867ce6831
3 changed files with 7 additions and 1 deletions
|
|
@ -10,6 +10,9 @@
|
|||
listen_port = 8080
|
||||
listen_port_tls = 8443
|
||||
|
||||
# Optional. If you listen on a custom port like 8443 but redirect with firewall to 443
|
||||
# tls_redirection_port = 443
|
||||
|
||||
# Optional for h2 and http1.1
|
||||
tcp_listen_backlog = 1024
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ pub struct ConfigToml {
|
|||
pub listen_port: Option<u16>,
|
||||
pub listen_port_tls: Option<u16>,
|
||||
pub listen_ipv6: Option<bool>,
|
||||
pub tls_redirection_port: Option<u16>,
|
||||
pub tcp_listen_backlog: Option<u32>,
|
||||
pub max_concurrent_streams: Option<u32>,
|
||||
pub max_clients: Option<u32>,
|
||||
|
|
@ -107,6 +108,8 @@ impl TryInto<ProxyConfig> for &ConfigToml {
|
|||
// listen port and socket
|
||||
http_port: self.listen_port,
|
||||
https_port: self.listen_port_tls,
|
||||
https_redirection_port: if self.tls_redirection_port.is_some() {
|
||||
self.tls_redirection_port } else { self.listen_port_tls },
|
||||
..Default::default()
|
||||
};
|
||||
ensure!(
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ where
|
|||
"Redirect to secure connection: {}",
|
||||
<&ServerName as TryInto<String>>::try_into(&backend_app.server_name).unwrap_or_default()
|
||||
);
|
||||
return secure_redirection_response(&backend_app.server_name, self.globals.proxy_config.https_port, &req);
|
||||
return secure_redirection_response(&backend_app.server_name, self.globals.proxy_config.https_redirection_port, &req);
|
||||
}
|
||||
|
||||
// Find reverse proxy for given path and choose one of upstream host
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue