Open schwamic opened 3 years ago
Thanks for the suggestion @schwamic ! 😄
@schwamic Thanks a lot, saved my day!
@alallema
The X-Meili-Api-Key
is outdated. Could you please verify if the rest of the settings are up to date?
Thanks! 🙏
I ran into the exact same problem with my Laravel forge deployed Meilisearch Instance. This is how my location block now looks like:
location / {
proxy_hide_header Access-Control-Allow-Origin;
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' 'https://meilisearch-ui.riccox.com';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'x-meilisearch-client,Authorization,Content-Type';
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
if ($request_method != 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' 'https://meilisearch-ui.riccox.com';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'x-meilisearch-client,Authorization,Content-Type';
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH';
}
proxy_pass http://127.0.0.1:7700;
}
Hello @internetztube
The link in this issue is outdated, here is the new one: https://www.meilisearch.com/docs/learn/cookbooks/running_production#a-quick-introduction
Also, the issues of this repository are focused on the maintenance of the Meilisearch documentation. If you want direct support, I recommend asking your question on our Discord. People will be there to help you
I just left this comment here to help other folks who are stumbling across the same issue. Regarding the documentation, I cannot find any resources that mention CORS.
site:meilisearch.com "cors"
PRs are welcome to fix documentation about this ❤️
Since the prod tutorial didn't work for me due to cors issues, I thought it might be helpful for others if there is an optional cors setting in the docs for an nginx.conf.
I added this cors settings for my environments (code based on enable-cors.org):