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

cors error #199

Closed
huongtran84 opened this issue Jul 31, 2022 · 2 comments
Closed

cors error #199

huongtran84 opened this issue Jul 31, 2022 · 2 comments
Labels
support Issues related to support questions.

Comments

@huongtran84
Copy link

Description
request to indexes to search

Screenshots or Logs
Access to XMLHttpRequest at 'http://67.205.159.1xx/indexes/dm_bao_gia/search' from origin 'http://localhost:63584' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

configuration server file:

`server {
# END - Enable CORSserver {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;

access_log /var/log/nginx/meilisearch.access.log;
error_log /var/log/nginx/meilisearch.error.log;

location / {
   proxy_pass  http://127.0.0.1:7700;
# START - Enable CORS
proxy_hide_header Access-Control-Allow-Origin;
if ($request_method = 'OPTIONS') {
  add_header 'Access-Control-Max-Age' 1728000;
  add_header "Access-Control-Allow-Origin"  *;
  add_header "Access-Control-Allow-Methods" "GET, POST, OPTIONS, PUT";
  add_header "Access-Control-Allow-Headers" "Authorization, Origin, X-Requested-With, Content-Type, Accept, >
  return 204;
}

if ($request_method != 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
}

# END - Enable CORS
}

}

`

Environment (please complete the following information):

  • OS: [e.g. Debian GNU/Linux]
  • Meilisearch version: [ v.0.28.1]
  • meilisearch-dart version: [e.g v0.6.0]
@brunoocasali brunoocasali added the support Issues related to support questions. label Aug 2, 2022
@brunoocasali
Copy link
Member

@huongtran84 can you share more information about what is your current environment? Having issues with CORS is not common around here. I believe this could be related to your environment or the way you're using it.

@brunoocasali
Copy link
Member

@huongtran84 I saw this discussion here meilisearch/meilisearch#2641, and I think you're talking about the same problem, correct? So I'll close this issue, and feel free to reopen it if you want!

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

No branches or pull requests

2 participants