Added content-security policy for SVG files in webserver config

This commit is contained in:
Jan Böhmer 2025-05-18 20:38:53 +02:00
parent 7e34535e62
commit 2b694731ad
2 changed files with 12 additions and 0 deletions

View file

@ -52,6 +52,11 @@ server {
location ~ \.php$ {
return 404;
}
# Set Content-Security-Policy for svg files, to block embedded javascript in there
location ~* \.svg$ {
add_header Content-Security-Policy "default-src 'self'; script-src 'none'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; frame-ancestors 'none';";
}
error_log /var/log/nginx/parts.error.log;
access_log /var/log/nginx/parts.access.log;