Reproduce the failure and note the exact origin the browser sends and the origin of the page serving the form.

Check the site value in the Astro config and any canonical URL your deployment uses.

If a proxy or preview deployment serves the site under a different host, make the form post to the same origin the page was served from rather than a hardcoded production URL.

Confirm any reverse proxy forwards the original host and protocol headers instead of rewriting them.

Only if the form must accept submissions from other origins by design, set the origin check off under the security checkOrigin option in the Astro config and add your own CSRF protection in the endpoint.

Redeploy and submit the form from the real page.