refactor: allow custom nginx command to be set as an nginx property

This avoids adding a new environment variable in favor of a script that can be called both globally as well as on a per-app basis.
This commit is contained in:
Jose Diaz-Gonzalez
2025-06-30 03:29:43 -04:00
parent a331d27945
commit 06de81b61b
5 changed files with 58 additions and 18 deletions

View File

@@ -234,6 +234,36 @@ func AppNginxConfSigilPath(appName string) string {
return common.PropertyGet("nginx", appName, "nginx-conf-sigil-path")
}
func ComputedNginxConfSigilPath(appName string) string {
appValue := AppNginxConfSigilPath(appName)
if appValue != "" {
return appValue
}
return GlobalNginxConfSigilPath()
}
func GlobalNginxConfSigilPath() string {
return common.PropertyGetDefault("nginx", "--global", "nginx-conf-sigil-path", "nginx.conf.sigil")
}
func AppNginxServiceCommand(appName string) string {
return common.PropertyGet("nginx", appName, "nginx-service-command")
}
func ComputedNginxServiceCommand(appName string) string {
appValue := AppNginxServiceCommand(appName)
if appValue != "" {
return appValue
}
return GlobalNginxServiceCommand()
}
func GlobalNginxServiceCommand() string {
return common.PropertyGetDefault("nginx", "--global", "nginx-service-command", "")
}
func AppKeepaliveTimeout(appName string) string {
return common.PropertyGet("nginx", appName, "keepalive-timeout")
}
@@ -268,19 +298,6 @@ func GlobalLingeringTimeout() string {
return common.PropertyGetDefault("nginx", "--global", "lingering-timeout", "5s")
}
func ComputedNginxConfSigilPath(appName string) string {
appValue := AppNginxConfSigilPath(appName)
if appValue != "" {
return appValue
}
return GlobalNginxConfSigilPath()
}
func GlobalNginxConfSigilPath() string {
return common.PropertyGetDefault("nginx", "--global", "nginx-conf-sigil-path", "nginx.conf.sigil")
}
func AppProxyBufferSize(appName string) string {
return common.PropertyGet("nginx", appName, "proxy-buffer-size")
}