From 0372224c28d05192dbe612a16a2df2c4bace6a00 Mon Sep 17 00:00:00 2001 From: Nick Sergeant Date: Mon, 6 Oct 2014 10:18:08 -0400 Subject: [PATCH] Add underscore subdomain redirect back in nginx.conf. --- .docker/nginx.conf | 11 +++++++++++ 1 file changed, 11 insertions(+) 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;