HTTP Headers Analyzer
Paste the output of curl -I to check security headers, CORS, cookies, caching and redirects, with the nginx lines to fix them.
● Runs 100% in your browser — nothing you type leaves this page.
Run one of these, on your own machine
$ curl -sIL https://example.com/$ curl -sI -H 'Origin: https://app.example.com' https://example.com/api/🔒 Checked in your browser and never sent or stored. Headers can hold session cookies, so this text isn't kept in the page address either.
How to use it
- Run
curlagainst your site, from a terminal.-Iasks only for the headers,-Lfollows redirects, and-shides the progress bar. - Paste the result.
curl -voutput works too. - Read what it found, worst first, and copy the nginx lines for anything you want to fix.
Why do I have to paste it?
Your browser won’t let a web page read another site’s headers, and this site has no server of its own to fetch them for you. There’s a benefit, though: you can check an internal site, or a staging server that’s not on the internet, and nothing you paste leaves your browser. It isn’t stored or put in the page address, because headers can contain session cookies.
What it checks
| Group | Headers |
|---|---|
| Security | Strict-Transport-Security, Content-Security-Policy, X-Content-Type-Options, X-Frame-Options, Referrer-Policy, Permissions-Policy |
| Cookies | Secure, HttpOnly and SameSite on every Set-Cookie |
| CORS | Access-Control-Allow-Origin and -Credentials, and Vary: Origin |
| Giving things away | Versions in Server, X-Powered-By |
| Caching | Cache-Control, and what a CDN reports |
| Redirects | Missing Location, redirects to plain HTTP, long chains |
It reads text, so it doesn’t test your site: it can’t tell whether a CSP suits your pages, or try an attack. A clean result means these headers look right, not that the site is secure.
Testing CORS
A server usually only sends CORS headers when the request has an Origin, so plain curl -I may show nothing. Pretend to be the other site:
curl -sI -H 'Origin: https://app.example.com' https://api.example.com/itemsFor the preflight that browsers send before a PUT or a request with a custom header:
curl -si -X OPTIONS https://api.example.com/items \ -H 'Origin: https://app.example.com' \ -H 'Access-Control-Request-Method: PUT'Adding the headers in nginx
The Nginx Config Generator can add the security headers for you. Otherwise, put the suggested lines inside your server block. Two rules catch people out:
- Keep
always, or the header is left off error pages. add_headerin alocationcancels everyadd_headerfrom theserverblock. If a location has one of its own, repeat the others there.
sudo nginx -t && sudo systemctl reload nginxcurl -sI https://example.com/ | grep -i strict-transportFAQ
Should I turn on HSTS right away?
Not before HTTPS works on every address you use. Browsers remember it for as long as max-age says, so if the certificate breaks, visitors can’t click past the warning. Start with a short value, such as max-age=300, then raise it. Add includeSubDomains only if all subdomains have HTTPS.
A strict CSP broke my site
That’s common, as it blocks inline scripts and anything from other domains. Send Content-Security-Policy-Report-Only first. Nothing gets blocked, and the browser’s console lists what would have been. Fix those, then switch to the real header.
Why did it warn about the Server header?
A version number tells attackers which known holes to try. Hiding it isn’t protection on its own, so keep updating. In nginx, server_tokens off; removes the number.
My browser says “blocked by CORS policy”. What now?
Check the real response here, using the Origin command above. The usual reasons are a missing header, * together with credentials, or the header appearing twice because both your app and your proxy add it. For the fixes, see Blocked by CORS policy.
Can it find a redirect loop?
Not by itself, but the list of responses can show one starting. If the browser says “too many redirects”, see ERR_TOO_MANY_REDIRECTS.
Articles
Learn more
Nginx "upstream sent too big header while reading response header": raise the right buffer
Fix Nginx "upstream sent too big header while reading response header from upstream" and its 502: measure the headers, then raise the right buffer.
Intermediate · 3 min read
"Blocked by CORS policy": what the browser is really refusing, and how to fix it on the server
Fix "has been blocked by CORS policy: No Access-Control-Allow-Origin header": why it happens, the fix on the server or in Nginx, preflight requests, and cookies.
Intermediate · 4 min read
Nginx for a React or Vite single-page app: routes, caching and an API proxy
Serve a React, Vue or Vite single-page app with Nginx: fix 404s on refresh with try_files, cache hashed assets, avoid caching index.html, and proxy /api to your backend.
Beginner · 3 min read
ERR_TOO_MANY_REDIRECTS with Nginx and Cloudflare: find the loop and break it
Fix ERR_TOO_MANY_REDIRECTS: follow the loop with curl, then fix Cloudflare Flexible SSL, HTTPS redirects behind a proxy, X-Forwarded-Proto and www redirects that fight.
Intermediate · 4 min read