Troubleshooting CORS Issues in Self-Hosted Typesense
TLDR Ankit faced CORS issues with self-hosted Typesense. Jason suggested correct configuration but the problem was mixed content (HTTP vs HTTPS).
Powered by Struct AI

6
4mo
Solved
May 24, 2023 (4 months ago)
Ankit
Ankit
05:15 PMHey All, quick question, dealing with the dreaded CORS issue. I have a self-hosted Typesense that I'm testing on V0.24.0. I have added
enable_cors = 1
it to the config file. My localhost JS integration can connect, but my staging server is getting a CORS error. Any other things that I should be checking for?Jason
Jason
05:44 PMIt should be
enable-cors = true
05:44
Jason
05:44 PM(hyphenated, and true/false)
Ankit
Ankit
05:45 PMYeah, I had tried that too and didn't work for me.
Jason
Jason
05:51 PMCould you share the exact CORS error you’re seeing?
Ankit
Ankit
05:57 PMAh, I think it's not CORS. It's blocking HTTP vs HTTPS mixed content. Thanks!

Typesense
Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI
Indexed 2764 threads (79% resolved)
Similar Threads
Troubleshooting CORS Enablement in Typesense Server
Pavan was unable to access Typesense server despite enabling CORS. Kishore Nallan confirmed that CORS was working fine as the required header was present.
5
13mo
Solved
Resolving CORS Error in Typesense Server Setup
Digamber had a CORS error with Typesense server setup. Kishore Nallan solved the error by suggesting to use only `--enable-cors` without adding `=true`.
6
21mo
Solved
Troubleshooting CORS Errors After Upgrading TypeSense Version
em1nos experienced CORS errors after upgrading TypeSense on their server. Kishore Nallan suggested setting environment variable as TRUE which solved the issue.
6
15mo
Solved