OLD | NEW |
1 <% if @aliases %> | 1 <%- if @aliases %> |
2 <% @aliases.each do |vhost_alias| %> | 2 <%- @aliases.each do |vhost_alias| %> |
3 server | 3 server |
4 { | 4 { |
5 listen 80; | 5 server_name '<%= vhost_alias %>'; |
6 listen [::]:80; | |
7 listen 443 ssl spdy; | |
8 listen [::]:443 ssl spdy; | |
9 | 6 |
10 server_name '<%= vhost_alias %>'; | 7 listen 80; |
| 8 listen [::]:80; |
| 9 <%- if @certificate != @private_key %> |
| 10 listen 443 ssl spdy; |
| 11 listen [::]:443 ssl spdy; |
11 | 12 |
12 ssl_certificate <%= certificate %>; | 13 ssl_certificate <%= @certificate %>; |
13 ssl_certificate_key <%= private_key %>; | 14 ssl_certificate_key <%= @private_key %>; |
14 | 15 |
15 location / | 16 location / |
16 { | 17 { |
17 rewrite .* https://<%= vhost %>/ redirect; | 18 rewrite .* https://<%= @vhost %>/ redirect; |
18 } | 19 } |
19 } | 20 <%- else %> |
20 <% end %> | 21 |
21 <% end %> | 22 location / |
| 23 { |
| 24 rewrite .* http://<%= @vhost %>/ redirect; |
| 25 } |
| 26 <%- end %> |
| 27 } |
| 28 <%- end %> |
| 29 <%- end %> |
| 30 |
OLD | NEW |