Skip to content
FixSecurityHeadersScan a site

Only the domain and grade are shown. Uncheck to remove it.

www.python.org

Score 38/100 · Stack Nginx · HTTP 200

Final URL: https://www.python.org/ · Scanned Fri, 27 Nov 2026 07:55:28 GMT

PCI DSS 4.0 6.4.3 & 11.6.1NIST 800-171 / CMMC L2OWASP ASVS V14.4SOC 2 CC6

Email me this report

We'll send the grade and a link to this report. One email, no newsletter.

Header results

Your fixes

Detected Nginx from Server: nginx.

Copy all: Nginx

Paste into nginx.conf (server block). Run nginx -t, then systemctl reload nginx.

nginx.conf (server block)
# Inside your server { } block
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data: https:; object-src 'none'; base-uri 'self'; frame-ancestors 'none'; form-action 'self'; upgrade-insecure-requests" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=(), usb=()" always;
add_header Cross-Origin-Opener-Policy "same-origin" always;
add_header Cross-Origin-Resource-Policy "same-origin" always;
  • Add the always flag, otherwise nginx only sends the header on 200, 201, 204, 206, 301, 302, 303, 304, 307 and 308 responses. Your 404 and 500 pages go out bare.
  • A location block with its own add_header drops every add_header inherited from the server block. Repeat them or put them in an include file.

Content-Security-Policy

What it does
CSP lists where your page is allowed to load scripts, styles, images, frames and connections from. Anything not on the list gets blocked. It's the best header-level defence against cross-site scripting you have.
Risk if missing
With no CSP, any script that gets onto the page (an XSS bug, a compromised analytics tag, a Magecart skimmer) runs with full access to your users' sessions and whatever they type into your forms.

Recommended value: default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data: https:; object-src 'none'; base-uri 'self'; frame-ancestors 'none'; form-action 'self'; upgrade-insecure-requests

Content-Security-Policy · Nginx
# Inside your server { } block
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data: https:; object-src 'none'; base-uri 'self'; frame-ancestors 'none'; form-action 'self'; upgrade-insecure-requests" always;

Gotchas

  • Ship it as Content-Security-Policy-Report-Only first and read the violation reports for a week or two before you enforce.
  • 'unsafe-inline' or 'unsafe-eval' in script-src throws away most of the XSS protection. Use nonces or hashes instead.
  • Analytics, chat widgets and payment iframes each need their hosts added. Expect to find a few you forgot about.
  • Send one CSP header, not two. Multiple policies are intersected, so the result is usually stricter than either one and things break in confusing ways.
Full guide: Content-Security-Policy on Nginx

X-Content-Type-Options

What it does
With nosniff set, the browser trusts the Content-Type you send instead of guessing from the file contents. An uploaded .txt file stays a text file and can't be run as a script.
Risk if missing
MIME sniffing can turn user uploads or JSON responses into something the browser executes as script or applies as a stylesheet.

Recommended value: nosniff

X-Content-Type-Options · Nginx
# Inside your server { } block
add_header X-Content-Type-Options "nosniff" always;

Gotchas

  • If your server sends wrong Content-Type values (JavaScript served as text/plain is the classic), those files will stop loading once nosniff is on. Fix the types, don't drop the header.
Full guide: X-Content-Type-Options on Nginx

Referrer-Policy

What it does
Referrer-Policy decides what URL information the browser sends in the Referer header when users click a link or your page loads something from another site.
Risk if missing
Full URLs can leak to third parties, including password reset tokens, search terms and internal paths you'd rather nobody saw.

Recommended value: strict-origin-when-cross-origin

Referrer-Policy · Nginx
# Inside your server { } block
add_header Referrer-Policy "strict-origin-when-cross-origin" always;

Gotchas

  • no-referrer is stricter, but it can wreck analytics attribution and break some payment and SSO flows that check the referrer.
Full guide: Referrer-Policy on Nginx

Permissions-Policy

What it does
Permissions-Policy switches off powerful browser APIs for your page and anything it embeds, unless you explicitly allow them.
Risk if missing
An injected or third-party script could ask for the camera, microphone, location or payment APIs. Most sites never use these, so there's no reason to leave them available.

Recommended value: camera=(), microphone=(), geolocation=(), payment=(), usb=()

Permissions-Policy · Nginx
# Inside your server { } block
add_header Permissions-Policy "camera=(), microphone=(), geolocation=(), payment=(), usb=()" always;

Gotchas

  • Allow the features you actually use, for example payment=(self) if your checkout uses the Payment Request API.
  • Drop interest-cohort=() if you copied it from an old guide. FLoC was abandoned and browsers now log a console warning for it.
Full guide: Permissions-Policy on Nginx

Cross-Origin-Opener-Policy

What it does
COOP puts your page in its own browsing context group, so a window opened from another origin can't get a reference to it (and vice versa).
Risk if missing
Cross-window attacks like XS-Leaks and tabnabbing, plus Spectre-style side channels.

Recommended value: same-origin

Cross-Origin-Opener-Policy · Nginx
# Inside your server { } block
add_header Cross-Origin-Opener-Policy "same-origin" always;

Gotchas

  • OAuth and payment pop-ups that report back through window.opener will break under same-origin. Use same-origin-allow-popups for those pages.
Full guide: Cross-Origin-Opener-Policy on Nginx

Cross-Origin-Resource-Policy

What it does
CORP tells browsers which origins are allowed to embed your images, scripts and other files.
Risk if missing
Other sites can embed your resources and use side channels to infer data from them.

Recommended value: same-origin

Cross-Origin-Resource-Policy · Nginx
# Inside your server { } block
add_header Cross-Origin-Resource-Policy "same-origin" always;

Gotchas

  • Assets that other sites are meant to embed (a public CDN, an embeddable widget) need cross-origin instead.
Full guide: Cross-Origin-Resource-Policy on Nginx

Raw response headers

curl -I https://www.python.org/
connection: close
content-length: 52085
x-frame-options: SAMEORIGIN
content-security-policy-report-only: frame-ancestors 'self'; style-src 'self' 'unsafe-inline' https://ajax.googleapis.com; default-src 'self'; font-src 'self' data:; script-src 'self' 'nonce-ODBQsKL22ZhdPLahc0ZM3w==' https://analytics.python.org https://media.ethicalads.io https://server.ethicalads.io https://ajax.googleapis.com; object-src 'none'; form-action 'self'; connect-src 'self' https://console.python.org https://analytics.python.org https://server.ethicalads.io https://2p66nmmycsj3.statuspage.io; frame-src 'self' https://console.python.org; base-uri 'self'; img-src 'self' data: https:
server: nginx
via: 1.1 varnish, 1.1 varnish
content-type: text/html; charset=utf-8
accept-ranges: bytes
date: Fri, 27 Nov 2026 07:55:28 GMT
age: 337
x-served-by: cache-iad-kcgs7200043-IAD, cache-iad-kcgs7200043-IAD, cache-iad-kcgs7200020-IAD
x-cache: MISS, HIT
x-cache-hits: 0, 3
x-timer: S1795766128.012921,VS0,VE0
vary: Cookie, Accept-Encoding
strict-transport-security: max-age=63072000; includeSubDomains; preload