ingress-nginx跨域解决

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设置为自己的前端地址。

ingress-nginx跨域解决

上一篇:P3320 [SDOI2015]寻宝游戏(数剖+定理


下一篇:大数据平台搭建(Ambari +HDP)