添加 enable_nginx 选项(

This commit is contained in:
shenjack 2024-01-26 16:50:20 +08:00
parent 8f2747edfd
commit 33f49505a6
Signed by: shenjack
GPG Key ID: 7B1134A979775551

View File

@ -17,6 +17,8 @@ pub struct Config {
pub disable_access_log: bool, pub disable_access_log: bool,
/// FORCE_NOOPEN /// FORCE_NOOPEN
pub force_noopen: bool, pub force_noopen: bool,
/// ENABLE_NGINX
pub enable_nginx: bool,
} }
impl Config { impl Config {
@ -50,6 +52,10 @@ impl Config {
.unwrap_or_else(|_| "false".to_string()) .unwrap_or_else(|_| "false".to_string())
.parse::<bool>() .parse::<bool>()
.expect("FORCE_NOOPEN must be true or false"); .expect("FORCE_NOOPEN must be true or false");
let enable_nginx = std::env::var("ENABLE_NGINX")
.unwrap_or_else(|_| "false".to_string())
.parse::<bool>()
.expect("ENABLE_NGINX must be true or false");
Self { Self {
cluster_port, cluster_port,
cluster_id, cluster_id,
@ -58,6 +64,7 @@ impl Config {
no_demaon, no_demaon,
disable_access_log, disable_access_log,
force_noopen, force_noopen,
enable_nginx,
} }
} }
} }