diff --git a/kubernetes/helm_charts/core/nginx-public-ingress/values.j2 b/kubernetes/helm_charts/core/nginx-public-ingress/values.j2 index bfb60e8c8331b7111022528b6d454f5942c4988f..55795e82c7cdcedc412c209fc1ebd4085ecd60f5 100644 --- a/kubernetes/helm_charts/core/nginx-public-ingress/values.j2 +++ b/kubernetes/helm_charts/core/nginx-public-ingress/values.j2 @@ -140,43 +140,35 @@ proxyconfig: |- add_header Content-Type text/plain; return 200; } - location ~* ^/assets/public/(.*) { - # Enabling cache for Response code 200 - expires 1M; - add_header Pragma public; - add_header Cache-Control "public"; - # Enabling compression - gzip on; - gzip_min_length 100000; - gzip_proxied expired no-cache no-store private auth; - gzip_types application/javascript application/x-javascript text/javascript; - if ($request_method = OPTIONS ) { - add_header Access-Control-Allow-Origin "*" ; - add_header Access-Control-Allow-Methods "GET, OPTIONS, PATCH, POST"; - add_header Access-Control-Allow-Headers "Access-Control-Allow-Origin, Authorization, Content-Type, user-id"; - # add_header Access-Control-Allow-Credentials "true"; - add_header Content-Length 0; - add_header Content-Type text/plain; - return 200; - } - set $bucket "{{upstream_url}}"; - set $url_full '$1'; - proxy_http_version 1.1; - proxy_set_header Host "{{upstream_url.split('/')[0]|lower}}"; - proxy_set_header Authorization ''; - proxy_hide_header Access-Control-Allow-Origin; - proxy_hide_header Access-Control-Allow-Methods; - proxy_hide_header x-amz-id-2; - proxy_hide_header x-amz-request-id; - proxy_hide_header Set-Cookie; - proxy_ignore_headers "Set-Cookie"; - proxy_buffering off; - proxy_intercept_errors on; - add_header Access-Control-Allow-Origin "*"; - add_header Access-Control-Allow-Methods GET; - proxy_set_header X-Request-ID $sb_request_id; - proxy_pass https://$bucket/$url_full; - } + location ~* ^/assets/public/(.*) { + if ($request_method = OPTIONS ) { + add_header Access-Control-Allow-Origin "*" ; + add_header Access-Control-Allow-Methods "GET, OPTIONS, PATCH, POST"; + add_header Access-Control-Allow-Headers "Access-Control-Allow-Origin, Authorization, Content-Type, user-id"; + # add_header Access-Control-Allow-Credentials "true"; + add_header Content-Length 0; + add_header Content-Type text/plain; + return 200; + } + + set $s3_bucket "sunbirddevbbpublic.blob.core.windows.net"; + set $url_full '$1'; + proxy_http_version 1.1; + proxy_set_header Host $s3_bucket; + proxy_set_header Authorization ''; + proxy_hide_header Access-Control-Allow-Origin; + proxy_hide_header Access-Control-Allow-Methods; + proxy_hide_header x-amz-id-2; + proxy_hide_header x-amz-request-id; + proxy_hide_header Set-Cookie; + proxy_ignore_headers "Set-Cookie"; + proxy_buffering off; + proxy_intercept_errors on; + add_header Access-Control-Allow-Origin "*"; + add_header Access-Control-Allow-Methods GET; + proxy_pass https://$s3_bucket/sunbird-content-staging/$url_full; +} + if ( $arg_eHVyhwSdt ) { set $custom_header "Bearer $arg_eHVyhwSdt";