nginx-ingress中解决跨域问题:

在annotations:加入如下配置

 nginx.ingress.kubernetes.io/configuration-snippet: >

      more_set_headers "Access-Control-Allow-Origin: https://www.test.site";

      more_set_headers "Access-Control-Allow-Credentials: true";

      more_set_headers "Access-Control-Allow-Methods: GET, PUT, POST, DELETE,
      PATCH, OPTIONS";

      more_set_headers "Access-Control-Allow-Headers:
      DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization";

  https://www.test.site设置为自己的前端地址。

相关文章:

  • 2021-10-03
  • 2022-02-14
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-06
  • 2021-07-08
  • 2021-09-04
  • 2021-11-01
相关资源
相似解决方案