diff --git a/.docker/nginx.conf b/.docker/nginx.conf index 05778b7..9f3e9d1 100644 --- a/.docker/nginx.conf +++ b/.docker/nginx.conf @@ -72,6 +72,17 @@ http { root /app/snipt/static/img/; expires max; } + + location / { + rewrite_by_lua ' + if string.find(ngx.var.host, "_") then + local newHost, n = ngx.re.gsub(ngx.var.host, "_", "-") + ngx.redirect(ngx.var.scheme .. "://" .. newHost .. ngx.var.uri) + end + '; + proxy_pass http://backend_snipt; + proxy_set_header Host $host; + } location / { proxy_pass http://backend_snipt;