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:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user