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

Cross-Origin if i want access server on prod system #196

Open
rbrose opened this issue Oct 17, 2018 · 0 comments
Open

Cross-Origin if i want access server on prod system #196

rbrose opened this issue Oct 17, 2018 · 0 comments
Labels

Comments

@rbrose
Copy link

rbrose commented Oct 17, 2018

Hello,

i have this problem that i get Cross-Origin error if Client want call http://localhost:3000/api/login.

i have add a .htaccess with this inside:

######################

Handling Options for the CORS

 RewriteCond %{REQUEST_METHOD} OPTIONS
 RewriteRule ^(.*)$ $1 [L,R=204]

###################

Add custom headers

Header set X-Content-Type-Options "nosniff"
Header set X-XSS-Protection "1; mode=block"
   # Always set these headers for CORS.
Header always set Access-Control-Max-Age 1728000
Header always set Access-Control-Allow-Origin: "*"
Header always set Access-Control-Allow-Methods: "GET,POST,OPTIONS,DELETE,PUT"
Header always set Access-Control-Allow-Headers: "DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,C$
Header always set Access-Control-Allow-Credentials true

But i not helps. What i can do?

Thank you in advance.

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

No branches or pull requests

2 participants