diff --git a/dataplane/main.go b/dataplane/main.go index e07ed80..c9d2e5c 100644 --- a/dataplane/main.go +++ b/dataplane/main.go @@ -75,6 +75,7 @@ func handleNewConfig(w http.ResponseWriter, r *http.Request) { } func applyNginxConfig() error { + slog.Info("reloading nginx config") cmd := exec.Command("nginx", "-t") output, err := cmd.CombinedOutput() diff --git a/src/templates/nginx.conf.tmpl b/src/templates/nginx.conf.tmpl index a74a844..3d3e03a 100644 --- a/src/templates/nginx.conf.tmpl +++ b/src/templates/nginx.conf.tmpl @@ -7,7 +7,7 @@ limit_req_zone $binary_remote_addr zone={{ $.Username }}_{{ .ZoneName }}:{{ .Rat {{/* Server blocks */}} server { listen 8080; - server_name _; + server_name {{ .Username }}; access_log /var/log/nginx/users/{{ .Username }}/access.log; error_log /var/log/nginx/users/{{ .Username }}/error.log; diff --git a/src/watcher/watcher.go b/src/watcher/watcher.go index a846ec9..212f0a8 100644 --- a/src/watcher/watcher.go +++ b/src/watcher/watcher.go @@ -38,7 +38,7 @@ func Watch() { } confPath := filepath.Join(event.Name, "nginx.conf") - if _, err := os.Stat(confPath); err == nil { + if _, err = os.Stat(confPath); err == nil { sendNginxToDataplane(confPath) } continue