Merge pull request #74 from sylr/no-transform

Add Cache-Control header with no-transform directive
This commit is contained in:
El RIDO 2021-10-08 19:14:28 +02:00 committed by GitHub
commit 90d1fc1ba6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,6 +18,14 @@ server {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.js$ {
# no-transform tells Cloudflare and others to not change the content of
# the file and thus breaking SRI.
# https://developers.cloudflare.com/cache/about/cache-control#other
add header Cache-Control "public, max-age=3600, must-revalidate, no-transform";
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include /etc/nginx/location.d/*.conf;
fastcgi_pass unix:/run/php-fpm.sock;