Redirect HTTP to HTTPS on the same port
This configuration allows to redirect any HTTP connection to HTTPS, on the same port. This is useful when using a custom port. I'm adding this config here because it needs to be included in every server configuration, not just the main one, and this file is included in each website configuration.
This commit is contained in:
parent
30d407e922
commit
cd3cb06c6a
@ -38,6 +38,9 @@ ssl_early_data on;
|
||||
# HSTS, remove # from the line below to enable HSTS
|
||||
#add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
|
||||
|
||||
# Redirect http traffict to https on same port
|
||||
error_page 497 301 =307 https://$host:$server_port$request_uri;
|
||||
|
||||
# Optional additional headers
|
||||
#add_header Cache-Control "no-transform" always;
|
||||
#add_header Content-Security-Policy "upgrade-insecure-requests; frame-ancestors 'self'";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user