summary refs log tree commit diff stats
path: root/svc/conf.go
diff options
context:
space:
mode:
Diffstat (limited to 'svc/conf.go')
-rw-r--r--svc/conf.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/svc/conf.go b/svc/conf.go
index 90cac6a..f15bd13 100644
--- a/svc/conf.go
+++ b/svc/conf.go
@@ -15,6 +15,7 @@ import (
 // this struct.
 type Configuration struct {
 	Mu            sync.RWMutex
+	IsProxied     bool          `yaml:"BehindProxy"`
 	Port          int           `yaml:"ListenPort"`
 	LogFile       string        `yaml:"LogFile"`
 	DBType        string        `yaml:"DatabaseType"`
@@ -132,6 +133,7 @@ func parseConfigFlag() {
 func bindConfig() {
 	confObj.Mu.Lock()
 
+	confObj.IsProxied = viper.GetBool("BehindProxy")
 	confObj.Port = viper.GetInt("ListenPort")
 	confObj.LogFile = viper.GetString("LogFile")
 	confObj.DBType = strings.ToLower(viper.GetString("DatabaseType"))
@@ -157,7 +159,15 @@ func bindConfig() {
 	if *flagAssets != "" {
 		confObj.AssetsDir = *flagAssets
 	}
+	if *flagProxied {
+		confObj.IsProxied = true
+	}
 
+	if confObj.IsProxied {
+		log.Printf("Behind reverse proxy, not using host matching\n")
+	} else {
+		log.Printf("Matching host: %v\n", confObj.Instance.URL)
+	}
 	if confObj.StdoutLogging {
 		log.Printf("Logging to: stdout\n")
 	} else {
href='#n140'>140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171