推荐 最新
无心插柳柳成萌

caddy 跨域的问题 CORS 错误?

这个是我的caddyfile 配置文件 xxxx.com { encode zstd gzip file_server browse { root /srv/xxxx.com } } 我的站点有一些js css 我直接引入这些js css 提示我CORS 错误 我在网上了找了一些配置 发现都不对 如: xxx { encode zstd gzip header{ Access-Control-Allow-Origin "{http.request.header.Origin}" Access-Control-Allow-Credentials true Access-Control-Allow-Methods * Access-Control-Allow-Headers DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization } file_server browse { root /srv/xxx } } 如: xxxx { encode zstd gzip cors file_server browse { root /srv/xxx } } 这些都是不对的! 请问如何配置?

0
1
0
浏览量206