Add underscore subdomain redirect back in nginx.conf.

master
Nick Sergeant 2014-10-06 10:18:08 -04:00
parent c59801fd70
commit 0372224c28
1 changed files with 11 additions and 0 deletions

View File

@ -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;