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: Created May 24, 2016, 5:06 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 ff866502916599c6e7d54aab751ee0ebbd65fbdd..6cd83376db922373162a0cabe31b1f353f40599d 100644
--- a/modules/nginx/templates/site.erb
+++ b/modules/nginx/templates/site.erb
@@ -71,6 +71,10 @@ location = /50x.html
root /usr/share/nginx/html;
}
+if ($http_host ~ "\.$") {
Wladimir Palant 2016/05/24 19:08:07 Nit: The opening bracket belong on the next line.
+ rewrite ^(.*) $scheme://$host$1 permanent;
Wladimir Palant 2016/05/24 19:08:07 This relies on undocumented behavior, namely $host
+}
+
<% 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