redirect securely by setting HSTS header on both hosts
This commit is contained in:
parent
cb3dc0554e
commit
64ae9db37b
|
@ -8,9 +8,8 @@ server {
|
||||||
# listen on both hosts
|
# listen on both hosts
|
||||||
server_name example.com www.example.com;
|
server_name example.com www.example.com;
|
||||||
|
|
||||||
# and redirect to the https host (declared below)
|
# and redirect to the https equivalent (declared below).
|
||||||
# avoiding http://www -> https://www -> https:// chain.
|
return 301 https://$host$request_uri;
|
||||||
return 301 https://example.com$request_uri;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
|
|
Loading…
Reference in New Issue