From 9b7e570a8df25105df96de524316f399856491b7 Mon Sep 17 00:00:00 2001 From: drdla Date: Sat, 1 Sep 2012 18:46:27 +0300 Subject: [PATCH] Add parameter to rewrite www to non-www --- manifests/resource/vhost.pp | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/manifests/resource/vhost.pp b/manifests/resource/vhost.pp index 177485fb5..a98a8a45f 100644 --- a/manifests/resource/vhost.pp +++ b/manifests/resource/vhost.pp @@ -3,21 +3,23 @@ # This definition creates a virtual host # # Parameters: -# [*ensure*] - Enables or disables the specified vhost (present|absent) -# [*listen_ip*] - Default IP Address for NGINX to listen with this vHost on. Defaults to all interfaces (*) -# [*listen_port*] - Default IP Port for NGINX to listen with this vHost on. Defaults to TCP 80 -# [*ipv6_enable*] - BOOL value to enable/disable IPv6 support (false|true). Module will check to see if IPv6 -# support exists on your system before enabling. -# [*ipv6_listen_ip*] - Default IPv6 Address for NGINX to listen with this vHost on. Defaults to all interfaces (::) -# [*ipv6_listen_port*] - Default IPv6 Port for NGINX to listen with this vHost on. Defaults to TCP 80 -# [*index_files*] - Default index files for NGINX to read when traversing a directory -# [*proxy*] - Proxy server(s) for the root location to connect to. Accepts a single value, can be used in -# conjunction with nginx::resource::upstream -# [*proxy_read_timeout*] - Override the default the proxy read timeout value of 90 seconds -# [*ssl*] - Indicates whether to setup SSL bindings for this vhost. -# [*ssl_cert*] - Pre-generated SSL Certificate file to reference for SSL Support. This is not generated by this module. -# [*ssl_key*] - Pre-generated SSL Key file to reference for SSL Support. This is not generated by this module. -# [*www_root*] - Specifies the location on disk for files to be read from. Cannot be set in conjunction with $proxy +# [*ensure*] - Enables or disables the specified vhost (present|absent) +# [*listen_ip*] - Default IP Address for NGINX to listen with this vHost on. Defaults to all interfaces (*) +# [*listen_port*] - Default IP Port for NGINX to listen with this vHost on. Defaults to TCP 80 +# [*ipv6_enable*] - BOOL value to enable/disable IPv6 support (false|true). Module will check to see if IPv6 +# support exists on your system before enabling. +# [*ipv6_listen_ip*] - Default IPv6 Address for NGINX to listen with this vHost on. Defaults to all interfaces (::) +# [*ipv6_listen_port*] - Default IPv6 Port for NGINX to listen with this vHost on. Defaults to TCP 80 +# [*index_files*] - Default index files for NGINX to read when traversing a directory +# [*proxy*] - Proxy server(s) for the root location to connect to. Accepts a single value, can be used in +# conjunction with nginx::resource::upstream +# [*proxy_read_timeout*] - Override the default the proxy read timeout value of 90 seconds +# [*ssl*] - Indicates whether to setup SSL bindings for this vhost. +# [*ssl_cert*] - Pre-generated SSL Certificate file to reference for SSL Support. This is not generated by this module. +# [*ssl_key*] - Pre-generated SSL Key file to reference for SSL Support. This is not generated by this module. +# [*www_root*] - Specifies the location on disk for files to be read from. Cannot be set in conjunction with $proxy +# [*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); # # Actions: # @@ -44,7 +46,8 @@ $proxy = undef, $proxy_read_timeout = $nginx::params::nx_proxy_read_timeout, $index_files = ['index.html', 'index.htm', 'index.php'], - $www_root = undef + $www_root = undef, + $rewrite_www_to_non_www = false, ) { File {