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

update nginx.conf #678

Merged
merged 1 commit into from
Feb 9, 2023
Merged

update nginx.conf #678

merged 1 commit into from
Feb 9, 2023

Conversation

GoneLikeAir
Copy link
Contributor

Only add CORS header to grafana section in nginx.conf, otherwise it may encounter CORS error when using dashboard to manage multi clusters.

What type of PR is this?

Update nginx.conf

What this PR does / why we need it:

When using dashboard to manage multi clusters, if using the old nginx config will encounter CORS failure when accessing '/api/v1/recommendation' and other URLs, except those relative about grafana.

In #551 , @lbbniu delete CORS header from global section. But in this case, it will enconter CORS error when accessing grafana urls.
image

So, the solution is delete 'add_header Access-Control-Allow-Origin' from global section, and add it to grafana section:
image

Which issue(s) this PR fixes:

Fixes #551

…ay encounter CORS error when using dashboard to manage multi clusters
@qmhu
Copy link
Member

qmhu commented Feb 7, 2023

@GoneLikeAir Tested in local by quick start (https://gocrane.io/docs/getting-started/quick-start/), it's not work
image
image

@qmhu qmhu merged commit 7b43222 into gocrane:main Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants