You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

SvelteKit跨域POST提交被拦截问题求助(已配置ORIGIN)

Linux+Nginx反向代理SvelteKit应用出现跨域问题,ORIGIN环境变量配置无效

我在Linux服务器上用Nginx做反向代理,将sub.domain.com的流量转发到本地3000端口的SvelteKit应用,通过systemd管理服务并配置了ORIGIN环境变量:

[Service]
Environment=ORIGIN=https://sub.domain.com

我检查了请求头,Origin字段确实是正确的https://sub.domain.com,而且已经从Deno适配器切换到Node适配器,但跨域问题依然存在。

更新信息

请求相关信息如下:

GENERAL HEADERS
Request URL:     https://sub.domain.com/login?/login
Remote Address:  我的IP

REQUEST HEADERS
Host:    sub.domain.com
Origin:  https://sub.domain.com
Referer: https://sub.domain.com/login

我完全搞不懂为什么会出现跨域问题,调整ORIGIN环境变量也没有任何效果,求各位帮忙解决。

内容的提问来源于stack exchange,提问作者z0l1

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.20 17:22:35