redirect securely by setting HSTS header on both hosts

This commit is contained in:
Nico 2016-11-05 02:22:49 +01:00
parent cb3dc0554e
commit 64ae9db37b
1 changed files with 2 additions and 3 deletions

View File

@ -8,9 +8,8 @@ server {
# listen on both hosts
server_name example.com www.example.com;
# and redirect to the https host (declared below)
# avoiding http://www -> https://www -> https:// chain.
return 301 https://example.com$request_uri;
# and redirect to the https equivalent (declared below).
return 301 https://$host$request_uri;
}
server {