Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to enable Access-Control-Allow-Origin from gce-ingress #1646

Closed
ankit-rsystem opened this issue Dec 29, 2021 · 14 comments
Closed

How to enable Access-Control-Allow-Origin from gce-ingress #1646

ankit-rsystem opened this issue Dec 29, 2021 · 14 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. triage/needs-information Indicates an issue needs more information in order to work on it.

Comments

@ankit-rsystem
Copy link

We are facing an error related of CORS policy:

Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Is there any way to allow it from gce-ingress annotations ?

Please help.

@freehan
Copy link
Contributor

freehan commented Jan 11, 2022

Can you elaborate where did you get this error? When sending traffic to the ingress VIP?

@kundan2707
Copy link
Contributor

/triage needs-information

@k8s-ci-robot k8s-ci-robot added the triage/needs-information Indicates an issue needs more information in order to work on it. label Feb 16, 2022
@synvestable
Copy link

NGINX ingress allows you to do this...

annotations: 
  nginx.ingress.kubernetes.io/enable-cors: "true"
  nginx.ingress.kubernetes.io/cors-allow-origin: "www.example.com"

Is there an equivalent for the gce-ingress? I can't find any security features on it, the ingress is accessible to anyone externally.

@swetharepakula
Copy link
Member

/kind feature

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label May 20, 2022
@allenvino1
Copy link

+1

@tdi
Copy link

tdi commented Sep 13, 2022

+1 :)

@naxo8628
Copy link

+1

@swetharepakula
Copy link
Member

Work to allow users to specify custom response headers using the BackendConfig is in progress. I will update this ticket again once it it is available in GKE.

@jstncno
Copy link

jstncno commented Nov 4, 2022

+1

@swetharepakula
Copy link
Member

Custom response headers can now be configured through the BackendConfig CRD. This feature is available for new GKE 1.25+ clusters.

dup #1106

@ohshazbot
Copy link

I see that 1106 has been closed out, but it's unclear how this can be achieved as I'm not really seeing any documentation or examples for this new feature. Can anyone provide me an example so I don't have to check the box in the IAP console?

(apologies for the repost, I deleted for a period where I convinced myself that my issues something else)

@renaudguerin
Copy link

Custom response headers can now be configured through the BackendConfig CRD. This feature is available for new GKE 1.25+ clusters.

dup #1106

Hi @swetharepakula, it appears this isn't documented yet here ? Is this definitely GA ? There's only a mention of request (not response) headers. Thanks.

@swetharepakula
Copy link
Member

That is correct the field is not yet documented, but the field should be available for 1.25+ clusters.

We will work to update GKE public docs

@rotilho
Copy link

rotilho commented Oct 10, 2024

The current solution using BackendConfig doesn't appear to support multiple Access-Control-Allow-Origin values. Is there a way to handle this at the infrastructure level?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. triage/needs-information Indicates an issue needs more information in order to work on it.
Projects
None yet
Development

No branches or pull requests