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
|
@ -36,6 +36,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;
|
||||
|
@ -48,7 +53,10 @@ http {
|
|||
location = /robots.txt { access_log off; log_not_found off; }
|
||||
|
||||
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