twikoo icon indicating copy to clipboard operation
twikoo copied to clipboard

私有部署下导入评论会跨域

Open zhheo opened this issue 2 years ago • 5 comments

这个在twikoo这里可以解决吗,我配置了很久nginx,因为是反代过去的,配置了跨域后评论系统就会提示有多个跨域请求,无法使用。在nginx中删除添加跨域标头后评论可以用了,但是导入评论会提示跨域。

zhheo avatar Aug 09 '22 11:08 zhheo

image 导入类型twikoojson,控制台: Access to XMLHttpRequest at 'https://twikoo.zhheo.com/' from origin 'http://localhost:4000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

zhheo avatar Aug 09 '22 11:08 zhheo

部署方式:私有部署docker 地址:twikoo.zhheo.com

zhheo avatar Aug 09 '22 11:08 zhheo

我这里无法复现:

image

请提供以下信息:

  1. nginx 配置

  1. 管理面板密码

如涉及隐私,可通过邮箱 [email protected] 发送。

imaegoo avatar Aug 09 '22 13:08 imaegoo

导出的 json 文件大小是多少?json 过大也可能会导致问题,nginx 好像默认限制了 POST 请求大小。

image

imaegoo avatar Aug 09 '22 14:08 imaegoo

绕过nginx已经成功,非常感谢。这个issue可以作为后面进行私有部署小伙伴的参考。 image

我直接使用端口直连就可以导入了。导入之后再切换回反代即可。

zhheo avatar Aug 10 '22 01:08 zhheo