netmanagers / puppet-nginx

[UNMAINTAINED] Puppet Nginx module
http://www.example42.com
Other
37 stars 60 forks source link

parameter to enforce redirect HTTP to HTTPS #71

Open jrenggli opened 9 years ago

jrenggli commented 9 years ago

It's often a use case to support both http and https connections but redirect all requests from http to https. Currently you'd have to configure two vhost resources for this. What I'm looking for is a simple parameter (e.g. ssl_enforce) to achieve this with only one vhost resource.

The following snippet should be added

server {
       listen         80;
       server_name    my.domain.com;
       return         301 https://$server_name$request_uri;
} 

What do you think about this? Is this somewhat useful? What should be the name of this parameter?