When you run an Astro site with SSR (rendering the page on every request) behind a CDN or load balancer, Astro internally receives the request from the intermediary rather than the URL the visitor sees. The original host name and the fact that the connection is https are reconstructed from headers such as X-Forwarded-Host and X-Forwarded-Proto that the intermediary adds. If this reconstruction goes wrong, the canonical URL, redirect targets and OGP URLs built from Astro.url end up with internal values such as http://localhost:4321.
Astro 7.4.11 (published to npm on November 11, 2026; dates are in UTC throughout) changed how Astro decides whether to trust these headers. It is a security-hardening fix, but depending on how your intermediary is configured, the host name that was used before may no longer be used after the update. In this article, we lay out what to check before updating, based on the original text of the changes and the results of passing the same inputs to 7.4.10 and 7.4.12.
What changed in 7.4.11
Astro trusts forwarded headers only when you list the allowed host names in security.allowedDomains of astro.config.mjs. If it is not configured, X-Forwarded-Host is ignored. The type definition’s description says “If the header doesn’t match any allowed pattern, the header is ignored and the request’s original host is used instead.” In place of a header that is not allowed, the host of the request the server received is used.
The 7.4.11 CHANGELOG lists the following changes to this validation.
- Protocol, host and port are matched “together against each
security.allowedDomainsentry, instead of one at a time” - A forwarded protocol is applied only if the entry allows it for the host being used
- A forwarded port is applied only if it is listed in that host’s entry
- A forwarded host without
X-Forwarded-Protois “validated with the protocol of the server” - Entries with
port: '443'(or'80'for http) now match hosts that do not include a port HostandX-Forwarded-Hostonly accept the form “host name with an optional port”
In addition, a problem was fixed where, in a list mixing entries with and without a protocol, non-http(s) X-Forwarded-Proto values such as ftp and ws were accepted. 7.4.12 (November 13) did not change this validation; it mainly includes improvements such as reduced memory usage.
As of November 20, 2026, the latest version is 7.4.13 (November 18). 7.4.13 fixed a problem where the dev server blocked cross-origin requests from origins allowed by entries that specify a default port such as port: '443' (#18711). The CHANGELOG says “BaseApp.validateForwardedHost() now applies the same allowedDomains rules as the rest of Astro.” The file containing the validation function compared below (validate-headers) did not change between 7.4.12 and 7.4.13.
Results of passing the same inputs to 7.4.10 and 7.4.12
On November 15, 2026, we fetched astro 7.4.10 and 7.4.12 from npm, passed the same headers and allowlist to the validation function (validateForwardedHeaders) and compared the return values. The server-side values assume that the server internally receives http://localhost:4321. Values not included in the return value are not used, and the server-side values apply instead.
| Input (allowlist and received headers) | 7.4.10 | 7.4.12 |
|---|---|---|
example.com restricted to https. Only Host arrives, with no Proto | Host accepted | Host also rejected |
Same as above, and X-Forwarded-Proto: https also arrives | https and host accepted | https and host accepted |
The example.com entry has no port. 8443, listed only in another host’s entry, is forwarded | Port 8443 also accepted | Port rejected |
Entry with port: '443'. A host without a port arrives | Host rejected | Host accepted |
**.example.com. evil.test@www.example.com arrives | Accepted as is | Rejected |
Mixed entries with and without a protocol. X-Forwarded-Proto: ftp arrives | ftp accepted | ftp rejected |

The first row is the case where what your site displays may change after the update. If your intermediary adds only X-Forwarded-Host and not X-Forwarded-Proto, and your allowlist is restricted to protocol: 'https', the host that was accepted in 7.4.10 falls back to the internal value in 7.4.12. This is because 7.4.10 treated a missing Proto as https when matching.
Conversely, the entry with port: '443' in the fourth row did not match hosts without a port in 7.4.10. Because the type definition’s examples also use this form, sites configured as in the examples will have the host accepted for the first time in 7.4.11 and later. However, the dev server’s (astro dev) cross-origin check did not match entries written in this form up to 7.4.12 (the 7.4.13 fix mentioned above). When testing on a local dev server, use 7.4.13 or later.
Note that this comparison called the validation function directly. We have not verified real requests through adapters such as @astrojs/node, or behavior behind any specific CDN.
Which sites are affected and which are not
The headers are read by pages rendered on each request. Static sites that generate every page at build time (such as GH Media itself) do not use this validation, because Astro does not receive requests when the pages are served.
You should check the impact if your site meets all of the following conditions.
- It uses
output: 'server', or has pages set toprerender = falseindividually - It has
security.allowedDomainsconfigured - Pages or middleware build URLs from
Astro.url(orcontext.url)
According to the type definition’s description, form origin checking (security.checkOrigin) also works by comparing a header sent by the browser with “the Request URL.” Because a change in how the request URL is built may affect the result of this check, sites with forms should also confirm with real submissions after updating (this connection is the editorial team’s interpretation; we have not verified submission behavior).
What to check before updating (editorial suggestion)
- Write down your allowlist. For each entry in
security.allowedDomainsofastro.config.mjs, note whetherprotocolandportare specified. Entries with onlyprotocol: 'https', and configurations that list ports in separate entries, are the ones whose results changed in the comparison above. - Check the headers your intermediary adds. In the settings of your CDN, load balancer or reverse proxy (such as nginx), check whether
X-Forwarded-Protois added. For nginx, look for a line likeproxy_set_header X-Forwarded-Proto $scheme;. If it is not added,X-Forwarded-Hostalone may not be accepted in 7.4.11 and later. - Send the same headers in a test environment. Send a request such as
curl -H 'X-Forwarded-Host: www.example.com' -H 'X-Forwarded-Proto: https' http://localhost:4321/to the updated server (the latest version as of November 20, 2026 is 7.4.13), and check the canonical and redirect URLs. Also trying without Proto helps you catch gaps in your intermediary’s configuration. We did not run this command against a real server when writing this article. - Choose a fix. The proper fix is to have your intermediary add
X-Forwarded-Proto. You could also make the allowlist accept requests by removingprotocol, but that means accepting forwarding over http as well, so the editorial team does not recommend it.
We also covered a past case where an Astro update changed local scripts and output in our article on environment variables in Astro 7.4.5. The issue where authentication protection was bypassed in the Node adapter is covered in our article on the base setting.
Scope of verification
On November 15, 2026, we reviewed the withastro/astro CHANGELOG (7.4.11 and 7.4.12), the commit with the change (08e2cee, #18641), the type definition documentation and the npm publication dates (desk research). We also passed six inputs to the validation function in astro 7.4.10 and 7.4.12 fetched from npm and compared the results (Node.js 22.23.4). We did not test real requests through an adapter, behavior behind a CDN or load balancer, or run the curl command above. On November 20, 2026, we confirmed the CHANGELOG and change (#18711) for 7.4.13 (November 18), and that the file containing the validation function did not change in the diff from 7.4.12.
GleamHub’s website development consulting covers building websites with Astro and checking updates after launch. What to check depends on your setup, so please reach out through our contact form.
References
- withastro/astro — packages/astro/CHANGELOG.md
- withastro/astro — Mixed allowedDomains patterns no longer accept non-http(s) X-Forwarded-Proto values(#18641)
- withastro/astro — Fix allowedDomains entries with default ports being incorrectly blocked in astro dev(#18711)
- withastro/astro — type definition of security.allowedDomains (config.ts)
- npm — astro









