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

Failed to load resource: Origin domain.tld is not allowed by Access-Control-Allow-Origin. Status code: 200 #98

Open
Marcwa19197 opened this issue Mar 13, 2023 · 1 comment

Comments

@Marcwa19197
Copy link

Marcwa19197 commented Mar 13, 2023

Hello, im always getting "Failed to load resource: Origin domain.tld is not allowed by Access-Control-Allow-Origin. Status code: 200" if i press the button and check the Network-Inspector in my Browser.

How can i fix this? Im using the following nginx config as reverse proxy:

# this is required to proxy Grafana Live WebSocket connections.
map $http_upgrade $connection_upgrade {
  default upgrade;
  '' close;
}

upstream domain.tld {
  server localhost:3000;
}

server {
  listen 80;
  root /usr/share/nginx/html;
  index index.html index.htm;

  location / {
#    proxy_set_header Host $http_host;
#    add_header 'Access-Control-Allow-Origin' '*' always;
#    proxy_pass http://domain.tld;
            add_header  Access-Control-Allow-Origin "*";
            add_header  "Access-Control-Allow-Credentials" "true";
            add_header  "Access-Control-Allow-Methods" "GET, POST, OPTIONS";
            add_header  "Access-Control-Allow-Headers" "Authorization, origin, accept";

            proxy_pass http://localhost:3000;
            proxy_set_header Host $http_host;
            proxy_set_header X-Forwarded-Host $host:$server_port;
            proxy_set_header X-Forwarded-Server $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }

  # Proxy Grafana Live WebSocket connections.
  location /api/live/ {
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;
    proxy_set_header Host $http_host;
    proxy_pass http://domain.tld;
  }
}
@Marcwa19197
Copy link
Author

no one? :-/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant