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

Unified Diff: modules/web/templates/global.conf.erb

Issue 29326028: Issue 2999 - Integrate web::server SSL parameters with Hiera (Closed)
Patch Set: Issue 2999 - Recognize HTTP/S when dealing with host aliases Created Sept. 7, 2015, 1:21 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 | « 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/global.conf.erb
diff --git a/modules/web/templates/global.conf.erb b/modules/web/templates/global.conf.erb
index e108b25b1a90ddcbdc94eac76186538082511bc8..b3d9933df270e70d2c502a77aec24f2f68a784bf 100644
--- a/modules/web/templates/global.conf.erb
+++ b/modules/web/templates/global.conf.erb
@@ -1,21 +1,30 @@
-<% if @aliases %>
- <% @aliases.each do |vhost_alias| %>
- server
- {
- listen 80;
- listen [::]:80;
- listen 443 ssl spdy;
- listen [::]:443 ssl spdy;
+<%- if @aliases %>
+<%- @aliases.each do |vhost_alias| %>
+server
+{
+ server_name '<%= vhost_alias %>';
- server_name '<%= vhost_alias %>';
+ listen 80;
+ listen [::]:80;
+<%- if @certificate != @private_key %>
+ listen 443 ssl spdy;
+ listen [::]:443 ssl spdy;
- ssl_certificate <%= certificate %>;
- ssl_certificate_key <%= private_key %>;
+ ssl_certificate <%= @certificate %>;
+ ssl_certificate_key <%= @private_key %>;
+
+ location /
+ {
+ rewrite .* https://<%= @vhost %>/ redirect;
+ }
+<%- else %>
+
+ location /
+ {
+ rewrite .* http://<%= @vhost %>/ redirect;
+ }
+<%- end %>
+}
+<%- end %>
+<%- end %>
- 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