SatelliteWP / rocket-nginx

Rocket-Nginx is a Nginx configuration that makes WP-Rocket even faster by serving static pages directly without loading WordPress or PHP.
MIT License
579 stars 129 forks source link

hsts problem #192

Closed boutiquepcland closed 1 year ago

boutiquepcland commented 1 year ago

hello, I think I have a problem with hsts, the result is not good:

https://hstspreload.org/?domain=boutique-pcland.fr

Nevertheless :

Add header to HTML cached files

location ~ /wp-content/cache/wp-rocket/.html$ { etag on; add_header Vary "Accept-Encoding, Cookie"; add_header Cache-Control "no-cache, no-store, must-revalidate"; add_header X-Rocket-Nginx-Serving-Static $rocket_is_bypassed; add_header X-Rocket-Nginx-Reason $rocket_reason; add_header X-Rocket-Nginx-File $rocket_file; add_header X-Content-Type-Options "nosniff"; add_header X-XSS-Protection "1; mode=block"; add_header X-Frame-Options "SAMEORIGIN"; add_header "Referrer-Policy" "strict-origin-when-cross-origin"; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"; include /etc/nginx/rocket-nginx/conf.d/default/global..conf; include /etc/nginx/rocket-nginx/conf.d/default/http.*.conf; }

How to solve, I am using Plesk.

maximejobin commented 1 year ago

You can add your add_header rule in a file named global.hsts.conf.

According to your config, that file must be in the folder: /etc/nginx/rocket-nginx/conf.d/default/