netmanagers/puppet-nginx — pull request #52 by jplana (2014-03-31 08:33:37+00:00)
Title: Allow default vhost location to just redirect requests

Though I'm not a nginx expert, I had the need to create a vhost that just redirects to another address. To be more specific, I just wanted to send back a 301 when accessing the port 80 so users get redirected to port 443.

As the ```redirect``` parameter is not available within nginx::resource::vhost context, I'd need to create a "fake" location and then add the redirect. This PR allows to do the following:

```puppet
nginx::resource::vhost { 'example-80':
server_name => 'example.com',
listen_port => 80,
ensure => present,
redirect => 'https://example.com',
}
````