Nginx Security 資安 Header 設定

add_header Content-Security-Policy "default-src 'self' https:; script-src 'self' 'unsafe-inline' 'unsafe-eval' https:; style-src 'self' 'unsafe-inline' https:; img-src 'self' data: https:; font-src 'self' data: https:;";
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 no-referrer-when-downgrade;
add_header Permissions-Policy "gyroscope=(), magnetometer=(), microphone=(), midi=(), payment=()";

https://securityheaders.com/ 這個工具掃可以得到至少 A