Skip to content

Instantly share code, notes, and snippets.

@gpsarkar
Created May 21, 2018 20:27
Show Gist options
  • Save gpsarkar/4b6f9b48a21a7b2000d1a2311c0f7f51 to your computer and use it in GitHub Desktop.
Save gpsarkar/4b6f9b48a21a7b2000d1a2311c0f7f51 to your computer and use it in GitHub Desktop.
CSP report proxy
Note: The CSP report server should be on the same origin as the website, otherwise some browsers won't send the report. This can easily be achieved with a proxy. Here's an Nginx example:
location /csp-report {
rewrite ^(.*)$ / break; # Rewrite everything to just /
proxy_pass http://csp-report.herokuapp.com;
}
Ref: https://github.com/bu-ist/csp-report
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment