HTTP headers
Follow every redirect over HTTP and HTTPS, see the raw response headers and timings for each hop, and grade the security headers.
What this tool does
MtrXTools requests the URL and follows up to 10 redirects, showing the status code, headers and timing of every hop. Then it grades the security headers on the final page, the one visitors actually land on.
How the security headers are scored
Each header adds points, out of 100: A+ needs 95, A 85, B 70, C 55 and D 40.
Strict-Transport-Security(25): forces HTTPS on return visits. Full points need amax-ageof at least 180 days; one year withincludeSubDomainsis the usual choice.Content-Security-Policy(25): the strongest defence against cross-site scripting. A policy that allows'unsafe-inline'or'unsafe-eval'without nonces gets partial points.- Clickjacking protection (15):
X-Frame-Optionsor the CSPframe-ancestorsdirective. X-Content-Type-Options: nosniff(10),Referrer-Policy(10),Permissions-Policy(10) andCross-Origin-Opener-Policy(5).- Minus 5 each for a
Serverheader with a version number and forX-Powered-By, which tell attackers what to target.
A good starting set
For nginx, add these inside the server block (Apache uses Header always set). Test the CSP with Content-Security-Policy-Report-Only first, because a strict policy can block scripts the site needs.
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; add_header X-Content-Type-Options nosniff always; add_header Referrer-Policy strict-origin-when-cross-origin always; add_header X-Frame-Options DENY always;
Redirect codes and what they mean
301and308: permanent. Browsers and search engines remember them, and search ranking moves to the new URL.308also keeps the request method, which matters for forms and APIs.302and307: temporary. Use them for short-term moves, logins and A/B tests, not for permanent HTTPS orwwwredirects.- Every extra hop adds a round trip before the page starts loading. From any entry point (
http,https, with or withoutwww) aim for at most one redirect to the final URL.
Other headers worth reading
Cache-ControlandAge: how long browsers and CDNs may reuse the response. A CDN header such asCF-Cache-StatusorX-Cacheshows whether the request was a cache hit.Vary: which request headers change the response.Vary: *or a long list stops CDNs from caching well.Set-Cookie: session cookies should carrySecure,HttpOnlyand aSameSitevalue.
Questions
- Should I still set X-XSS-Protection?
- No. Modern browsers removed the XSS filter it controlled, and the header isn't graded. A Content-Security-Policy replaces it.
- Why does the grade use the last redirect?
- Headers on a redirect response are mostly ignored by browsers (HSTS is the exception). What protects visitors is what the final page sends, so that is what is graded.
- What does a redirect loop look like here?
- The chain stops after 10 hops with an error, and the hops show the same URLs repeating. That is the "too many redirects" error browsers show; it is usually a CDN set to flexible SSL talking to an origin that redirects to HTTPS.
Related tools
- Website healthEvery address, every entry point and upcoming expiries on one scorecard.
- CSP evaluatorHow well does a Content-Security-Policy stop XSS?
- SSL/TLS checkerChain, expiry, protocol versions and a grade.
- HSTS preload checkerIs the domain on the browsers' HTTPS-only list, or ready to submit?
- Status badgesLive TLS, DMARC, IPv6 and custom badges from any API.
- Error explainerPaste an error; get the cause, the fix and the right check.
- CORS testerWill the browser let another site call this API?
Errors this tool helps with
- ERR_TOO_MANY_REDIRECTS · The page redirects in a loop
- ERR_CONNECTION_CLOSED · The server closed the connection unexpectedly
- ERR_EMPTY_RESPONSE · The server didn't send any data
- ERR_HTTP2_PROTOCOL_ERROR · The HTTP/2 response was malformed or cut short
- ERR_QUIC_PROTOCOL_ERROR · The HTTP/3 (QUIC) connection failed
- curl: (18) transfer closed with outstanding read data remaining · The connection closed before the body finished
- curl: (22) The requested URL returned error · The server answered with an HTTP error status
- curl: (47) Maximum (50) redirects followed · curl stopped in a redirect loop
- curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1) · The server reset an HTTP/2 stream
- ECONNRESET · Connection reset by peer