feature/upstream-service #13
@@ -54,13 +54,13 @@ impl NginxConfigProvider for UpstreamInfo {
|
|||||||
.iter()
|
.iter()
|
||||||
.map(|target| target.to_nginx_config(Some(indent.unwrap_or(0) + INDENT_SIZE)))
|
.map(|target| target.to_nginx_config(Some(indent.unwrap_or(0) + INDENT_SIZE)))
|
||||||
.collect();
|
.collect();
|
||||||
|
let targets_config_str = if targets_config.is_empty() {
|
||||||
format!(
|
"server 127.0.0.1:65535 down; # placeholder target".to_string()
|
||||||
"upstream {} {{\n{}\n}}",
|
} else {
|
||||||
self.name,
|
targets_config.join("\n")
|
||||||
targets_config.join("\n".indent(indent.unwrap_or(0) + INDENT_SIZE).as_str())
|
}
|
||||||
)
|
.indent(indent.unwrap_or(0) + INDENT_SIZE);
|
||||||
.indent(indent.unwrap_or(0))
|
format!("upstream {} {{\n{}\n}}", self.name, targets_config_str).indent(indent.unwrap_or(0))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user