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

XMLHttpRequest cannot load. Origin is not allowed by Access-Control-Allow-Origin. #3347

Closed
causeidm opened this issue Jan 10, 2017 · 1 comment

Comments

@causeidm
Copy link

I have followed this guide

for every class loading I get this error:
XMLHttpRequest cannot load. Origin is not allowed by Access-Control-Allow-Origin.

I am trying to create a standalone parse server, keeping the website that accesses it separate, they have separate domains, both are https.

I have tried modifying the nginx "/etc/nginx/sites-enabled/default" file. under location I have tried

location /parse/ { proxy_set_header 'Access-Control-Allow-Origin' '*'; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-NginX-Proxy true; proxy_pass http://localhost:1337/; proxy_ssl_session_reuse off; proxy_set_header Host $http_host; proxy_redirect off; }

Have also tried

location /parse/ { add_header 'Access-Control-Allow-Origin' '*'; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-NginX-Proxy true; proxy_pass http://localhost:1337/; proxy_ssl_session_reuse off; proxy_set_header Host $http_host; proxy_redirect off; }

I have also tried adding this entire script

It seems to be an issue with the express server in parse-server that nginx is proxying to. I have been unable to figure out how to modify this. Help is appreciated.

@causeidm
Copy link
Author

Thanks for the response, using this post: cors_heroku_parse-server I was able to fix the issue by forking the server and adding cors

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