فهرست منبع

Install CORS rule on GET

Victor Lavaud 3 ماه پیش
والد
کامیت
46746f0242
1فایلهای تغییر یافته به همراه5 افزوده شده و 0 حذف شده
  1. 5 0
      ingress/ingress.yaml

+ 5 - 0
ingress/ingress.yaml

@@ -332,6 +332,11 @@ metadata:
     ingress.kubernetes.io/ssl-redirect: "true"
     nginx.org/redirect-to-https: "false"
     nginx.org/location-snippets: |
+     if ($request_method = 'GET') {
+       add_header 'Access-Control-Allow-Origin' '*';
+       add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT';
+       add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
+     }
      if ($request_method = 'POST') {
        add_header 'Access-Control-Allow-Origin' '*';
        add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT';