OLD | NEW |
1 <% include_file = lambda do |url| %> | 1 <% include_file = lambda do |url| %> |
2 <% content = Puppet::FileServing::Content.indirection.find(url) %> | 2 <% content = Puppet::FileServing::Content.indirection.find(url) %> |
3 <% if content %> | 3 <% if content %> |
4 <%= content.content %> | 4 <%= content.content %> |
5 <% else %> | 5 <% else %> |
6 <% raise StandardError, "Failed to resolve source URL #{url}" %> | 6 <% raise StandardError, "Failed to resolve source URL #{url}" %> |
7 <% end %> | 7 <% end %> |
8 <% end %> | 8 <% end %> |
9 | 9 |
10 <% server_name = lambda do |domain, alt_names| %><%= domain %><% @alt_names.each
do |name| %>, <%= name %><% end %><% end %> | 10 <% server_name = lambda do |domain, alt_names| %><%= domain %><% @alt_names.each
do |name| %>, <%= name %><% end %><% end %> |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 access_log /var/log/nginx/<%= log %> <%= log_format %>; | 64 access_log /var/log/nginx/<%= log %> <%= log_format %>; |
65 | 65 |
66 # redirect server error pages to the static page /50x.html | 66 # redirect server error pages to the static page /50x.html |
67 # | 67 # |
68 error_page 500 502 503 504 /50x.html; | 68 error_page 500 502 503 504 /50x.html; |
69 location = /50x.html | 69 location = /50x.html |
70 { | 70 { |
71 root /usr/share/nginx/html; | 71 root /usr/share/nginx/html; |
72 } | 72 } |
73 | 73 |
| 74 if ($http_host ~ "^(.+)\.$") |
| 75 { |
| 76 set $canonical_host $1; |
| 77 rewrite ^(.*) $scheme://$canonical_host$1 permanent; |
| 78 } |
| 79 |
74 <% if @content %> | 80 <% if @content %> |
75 <%= content %> | 81 <%= content %> |
76 <% end %> | 82 <% end %> |
77 | 83 |
78 <% if @source %> | 84 <% if @source %> |
79 <% include_file[source] %> | 85 <% include_file[source] %> |
80 <% end %> | 86 <% end %> |
81 } | 87 } |
OLD | NEW |