Skip to content

Instantly share code, notes, and snippets.

@section-io-gists
Last active April 3, 2017 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save section-io-gists/39e0ddc31cdd7ca8ae33 to your computer and use it in GitHub Desktop.
Save section-io-gists/39e0ddc31cdd7ca8ae33 to your computer and use it in GitHub Desktop.
Send standard HTTPS security headers with VCL
sub vcl_deliver {
set resp.http.X-Frame-Options = "SAMEORIGIN";
set resp.http.X-XSS-Protection = "1; mode=block";
set resp.http.X-Content-Type-Options = "nosniff";
set resp.http.Strict-Transport-Security= "max-age=31536000; includeSubDomains";
set resp.http.Content-Security-Policy-Report-Only = "default-src 'self' ; script-src 'self' r-login.wordpress.com s0.wp.com s1.wp.com s2.wp.com stats.wp.com 0.gravatar.com platform.twitter.com; style-src 'self' s2.wp.com 0.gravatar.com fonts.googleapis.com; img-src 'self' pixel.wp.com 2.gravatar.com ; font-src 'self' data: fonts.gstatic.com; upgrade-insecure-requests; report-uri https://example.report-uri-example.io/report/example-endpoint;";
unset resp.http.Server;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment