kubernetes解决nginx跨域问题

官方文档出处:

https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#enable-cors%20%E4%BD%9C%E8%80%85%EF%BC%9AKaliArch%20%E9%93%BE%E6%8E%A5%EF%BC%9Ahttps://www.imooc.com/article/details/id/300133%20%E6%9D%A5%E6%BA%90%EF%BC%9A%E6%85%95%E8%AF%BE%E7%BD%91%20%E6%9C%AC%E6%96%87%E9%A6%96%E6%AC%A1%E5%8F%91%E5%B8%83%E4%BA%8E%E6%85%95%E8%AF%BE%E7%BD%91%20%EF%BC%8C%E8%BD%AC%E8%BD%BD%E8%AF%B7%E6%B3%A8%E6%98%8E%E5%87%BA%E5%A4%84%EF%BC%8C%E8%B0%A2%E8%B0%A2%E5%90%88%E4%BD%9C


实际配置项目:

nginx.ingress.kubernetes.io/cors-allow-credentials: "true"

nginx.ingress.kubernetes.io/cors-allow-headers: '*'

nginx.ingress.kubernetes.io/cors-allow-methods: 'PUT, GET, POST, OPTIONS'

nginx.ingress.kubernetes.io/cors-allow-origin: '*'

你可能感兴趣的:(kubernetes解决nginx跨域问题)