OLD | NEW |
1 server | 1 server |
2 { | 2 { |
3 listen 80 default_server; | 3 <% if is_default %> |
4 listen [::]:80 default_server; | 4 listen 80 default_server; |
| 5 listen [::]:80 default_server; |
| 6 <% else %> |
| 7 listen 80; |
| 8 listen [::]:80; |
| 9 <% end %> |
| 10 |
5 server_name '<%= vhost %>'; | 11 server_name '<%= vhost %>'; |
6 | 12 |
7 location / | 13 location / |
8 { | 14 { |
9 rewrite (.*) https://<%= vhost %>$1 permanent; | 15 rewrite (.*) https://<%= vhost %>$1 permanent; |
10 } | 16 } |
11 } | 17 } |
12 | 18 |
13 server | 19 server |
14 { | 20 { |
15 listen 443 ssl default_server; | 21 <% if is_default %> |
16 listen [::]:443 ssl default_server; | 22 listen 443 ssl default_server; |
| 23 listen [::]:443 ssl default_server; |
| 24 <% else %> |
| 25 listen 443 ssl; |
| 26 listen [::]:443 ssl; |
| 27 <% end %> |
| 28 |
| 29 server_name '<%= vhost %>'; |
| 30 |
17 ssl_certificate sites-available/adblockplus.org_sslcert.pem; | 31 ssl_certificate sites-available/adblockplus.org_sslcert.pem; |
18 ssl_certificate_key sites-available/adblockplus.org_sslcert.key; | 32 ssl_certificate_key sites-available/adblockplus.org_sslcert.key; |
19 | 33 |
20 server_name '<%= vhost %>'; | |
21 | |
22 expires 1d; | 34 expires 1d; |
23 | 35 |
24 root /var/www/<%= vhost %>; | 36 root /var/www/<%= vhost %>; |
25 index index; | 37 index index; |
26 default_type text/html; | 38 default_type text/html; |
27 | 39 |
| 40 <% if custom_config %> |
| 41 <%= custom_config %> |
| 42 <% end %> |
| 43 |
28 # Match Accept-Language header against available languages | 44 # Match Accept-Language header against available languages |
29 | 45 |
30 set $preferredLang ""; | 46 set $preferredLang ""; |
31 if ($http_accept_language ~ ^(\w\w)-(\w\w)\b) | 47 if ($http_accept_language ~ ^(\w\w)-(\w\w)\b) |
32 { | 48 { |
33 set $preferrredLang $1_$2; | 49 set $preferrredLang $1_$2; |
34 } | 50 } |
35 if (!-f $document_root/$preferredLang/index) | 51 if (!-f $document_root/$preferredLang/index) |
36 { | 52 { |
37 set $preferredLang ""; | 53 set $preferredLang ""; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 <% if @multiplexer_locations %> | 103 <% if @multiplexer_locations %> |
88 <% @multiplexer_locations.each do |location| %> | 104 <% @multiplexer_locations.each do |location| %> |
89 location <%= location %> | 105 location <%= location %> |
90 { | 106 { |
91 fastcgi_pass unix:/tmp/multiplexer-fastcgi.sock; | 107 fastcgi_pass unix:/tmp/multiplexer-fastcgi.sock; |
92 include /etc/nginx/fastcgi_params; | 108 include /etc/nginx/fastcgi_params; |
93 } | 109 } |
94 <% end %> | 110 <% end %> |
95 <% end %> | 111 <% end %> |
96 } | 112 } |
| 113 |
| 114 <% if @aliases %> |
| 115 <% @aliases.each do |vhost_alias| %> |
| 116 server |
| 117 { |
| 118 listen 80; |
| 119 listen [::]:80; |
| 120 listen 443 ssl; |
| 121 listen [::]:443 ssl; |
| 122 |
| 123 server_name '<%= vhost_alias %>'; |
| 124 |
| 125 ssl_certificate sites-available/adblockplus.org_sslcert.pem; |
| 126 ssl_certificate_key sites-available/adblockplus.org_sslcert.key; |
| 127 |
| 128 location / |
| 129 { |
| 130 rewrite .* https://<%= vhost %>/ redirect; |
| 131 } |
| 132 } |
| 133 <% end %> |
| 134 <% end %> |
OLD | NEW |