Skip to content

Commit

Permalink
Merge pull request voxpupuli#53 from hingstarne/master
Browse files Browse the repository at this point in the history
Added some minor enhancements
  • Loading branch information
James Fryman committed May 15, 2013
2 parents cc8d2c5 + b84e410 commit ce64f8e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions manifests/resource/vhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
# [*rewrite_www_to_non_www*] - Adds a server directive and rewrite rule to rewrite www.domain.com to domain.com in order to avoid
# duplicate content (SEO);
# [*try_files*] - Specifies the locations for files to be checked as an array. Cannot be used in conjuction with $proxy.
# [*rewrite_to_https*] - Adds a server directive and rewrite rule to rewrite to ssl
# [*include_files*] - Adds include files to vhost
#
# Actions:
#
Expand Down Expand Up @@ -62,6 +64,7 @@
$server_name = [$name],
$www_root = undef,
$rewrite_www_to_non_www = false,
$rewrite_to_https = undef,
$location_cfg_prepend = undef,
$location_cfg_append = undef,
$try_files = undef) {
Expand All @@ -75,6 +78,7 @@
group => 'root',
mode => '0644',
}
$include_files = undef,

# Add IPv6 Logic Check - Nginx service will not start if ipv6 is enabled
# and support does not exist for it in the kernel.
Expand Down
3 changes: 3 additions & 0 deletions templates/vhost/vhost_footer.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<% if @include_files %><% @include_files.each do |file| -%>
include <%= file %>;
<% end -%><% end -%>
}

<% if rewrite_www_to_non_www %>
Expand Down
5 changes: 5 additions & 0 deletions templates/vhost/vhost_header.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ server {

<% proxy_set_header.each do |header| %>
proxy_set_header <%= header %>;<% end %>
<% if @rewrite_to_https %>
if ($ssl_protocol = "") {
return 301 https://$host$request_uri ;
}
<% end %>

0 comments on commit ce64f8e

Please sign in to comment.