fix bug for default app
This commit is contained in:
parent
65ade6df8c
commit
6466e7a309
2 changed files with 11 additions and 5 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
listen_port = 8080
|
listen_port = 8080
|
||||||
listen_port_tls = 8443
|
# listen_port_tls = 8443
|
||||||
listen_ipv6 = false
|
listen_ipv6 = false
|
||||||
|
|
||||||
max_concurrent_streams = 128
|
max_concurrent_streams = 128
|
||||||
|
|
|
||||||
|
|
@ -128,13 +128,19 @@ pub fn parse_opts(globals: &mut Globals, backends: &mut Backends) -> Result<()>
|
||||||
|
|
||||||
// default backend application for plaintext http requests
|
// default backend application for plaintext http requests
|
||||||
if let Some(d) = config.default_app {
|
if let Some(d) = config.default_app {
|
||||||
if backends.apps.contains_key(&d) {
|
let d_sn: Vec<&str> = backends
|
||||||
|
.apps
|
||||||
|
.iter()
|
||||||
|
.filter(|(_k, v)| v.app_name == d)
|
||||||
|
.map(|(_, v)| v.server_name.as_ref())
|
||||||
|
.collect();
|
||||||
|
if !d_sn.is_empty() {
|
||||||
info!(
|
info!(
|
||||||
"Serving plaintext http for requests to unconfigured server_name: {}.",
|
"Serving plaintext http for requests to unconfigured server_name by app {} (server_name: {}).",
|
||||||
d
|
d, d_sn[0]
|
||||||
);
|
);
|
||||||
|
backends.default_app = Some(d_sn[0].to_owned());
|
||||||
}
|
}
|
||||||
backends.default_app = Some(d);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue