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

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

Issue 5778562212691968: Added redirects for legacy URLs to eyeo.com configuration and added host name aliases (Closed)
Patch Set: Created Jan. 14, 2014, 10:41 a.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 | « modules/web/manifests/server.pp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/web/templates/site.erb
===================================================================
--- a/modules/web/templates/site.erb
+++ b/modules/web/templates/site.erb
@@ -1,35 +1,51 @@
server
{
- listen 80 default_server;
- listen [::]:80 default_server;
+ <% if is_default %>
+ listen 80 default_server;
+ listen [::]:80 default_server;
+ <% else %>
+ listen 80;
Felix Dahlke 2014/01/30 13:56:08 Ah, now I see where this came from for filterserve
+ listen [::]:80;
+ <% end %>
+
server_name '<%= vhost %>';
location /
{
rewrite (.*) https://<%= vhost %>$1 permanent;
}
}
server
{
- listen 443 ssl default_server;
- listen [::]:443 ssl default_server;
+ <% if is_default %>
+ listen 443 ssl default_server;
+ listen [::]:443 ssl default_server;
+ <% else %>
+ listen 443 ssl;
+ listen [::]:443 ssl;
+ <% end %>
+
+ server_name '<%= vhost %>';
+
ssl_certificate sites-available/adblockplus.org_sslcert.pem;
ssl_certificate_key sites-available/adblockplus.org_sslcert.key;
- server_name '<%= vhost %>';
-
expires 1d;
root /var/www/<%= vhost %>;
index index;
default_type text/html;
+ <% if custom_config %>
+ <%= custom_config %>
+ <% end %>
+
# Match Accept-Language header against available languages
set $preferredLang "";
if ($http_accept_language ~ ^(\w\w)-(\w\w)\b)
{
set $preferrredLang $1_$2;
}
if (!-f $document_root/$preferredLang/index)
@@ -89,8 +105,30 @@ server
location <%= location %>
{
fastcgi_pass unix:/tmp/multiplexer-fastcgi.sock;
include /etc/nginx/fastcgi_params;
}
<% end %>
<% end %>
}
+
+<% if @aliases %>
+ <% @aliases.each do |vhost_alias| %>
+ server
+ {
+ listen 80;
+ listen [::]:80;
+ listen 443 ssl;
+ listen [::]:443 ssl;
+
+ server_name '<%= vhost_alias %>';
+
+ ssl_certificate sites-available/adblockplus.org_sslcert.pem;
+ ssl_certificate_key sites-available/adblockplus.org_sslcert.key;
+
+ location /
+ {
+ rewrite .* https://<%= vhost %>/ redirect;
+ }
+ }
+ <% end %>
+<% end %>
« no previous file with comments | « modules/web/manifests/server.pp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld