Nginx CSP example
✓ Published0🌍 Public
Aackuser
Last edited Mar 4, 2015
Created on Apr 17, 2023
This example demonstrates a hardened Nginx configuration that adds security headers to HTTP responses, including `X-Frame-Options`, `X-Content-Type-Options`, `X-XSS-Protection`, and a `Content-Security-Policy` directive. It shows how the server restricts resource loading to trusted domains like YouTube, Google APIs, and Facebook, while permitting inline scripts and styles. The configuration uses Nginx’s `add_header` directive to apply these policies globally, illustrating a practical approach to mitigating clickjacking, content sniffing, and cross-site scripting attacks. The file is a plain-text server config, not a visualization, and relies solely on Nginx’s built-in header functionality.
AI-generated description