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?
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
What do you think about this? Is this somewhat useful? What should be the name of this parameter?