add hsts header and https redirect for reverse proxy setups
This commit is contained in:
parent
6a2f0ba6fe
commit
bee69cfbad
1 changed files with 9 additions and 1 deletions
|
@ -37,6 +37,11 @@ http {
|
|||
access_log off;
|
||||
error_log /var/log/nginx/pterodactyl.app-error.log error;
|
||||
|
||||
# Redirect to https
|
||||
if ($http_x_forwarded_proto != false && $http_x_forwarded_proto != "https") {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
|
@ -49,6 +54,9 @@ http {
|
|||
|
||||
sendfile off;
|
||||
|
||||
if ($http_x_forwarded_proto == "https") {
|
||||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;";
|
||||
}
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
add_header X-XSS-Protection "1; mode=block";
|
||||
add_header X-Robots-Tag none;
|
||||
|
|
Reference in a new issue