Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/nginx/templates/site.erb

Issue 29343003: Issue 4068 - Redirect tailing-dot hostname requests to use canonical domain name (Closed)
Patch Set: Issue 4068 - Redirect trailing-dot hostname requests to use canonical domain name Created May 25, 2016, 6:07 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/nginx/templates/site.erb
diff --git a/modules/nginx/templates/site.erb b/modules/nginx/templates/site.erb
index b51c98ee0875203273e5c8bcefd9c7f72a36e8c3..c2c07103234a6c84105f799d9038e45506359562 100644
--- a/modules/nginx/templates/site.erb
+++ b/modules/nginx/templates/site.erb
@@ -71,6 +71,12 @@ location = /50x.html
root /usr/share/nginx/html;
}
+if ($http_host ~ "^(.+)\.$")
+{
+ set $canonical_host $1;
+ rewrite ^(.*) $scheme://$canonical_host$1 permanent;
+}
+
<% if @content %>
<%= content %>
<% end %>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld