#random

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
+11
6
4mo
Solved
Join the chat
May 24, 2023 (4 months ago)
Ankit
Photo of md5-d9ca032e3941589aafa8433269974f96
Ankit
05:15 PM
Hey 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
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:44 PM
It should be enable-cors = true
05:44
Jason
05:44 PM
(hyphenated, and true/false)
Ankit
Photo of md5-d9ca032e3941589aafa8433269974f96
Ankit
05:45 PM
Yeah, I had tried that too and didn't work for me.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
05:51 PM
Could you share the exact CORS error you’re seeing?
Ankit
Photo of md5-d9ca032e3941589aafa8433269974f96
Ankit
05:57 PM
Ah, I think it's not CORS. It's blocking HTTP vs HTTPS mixed content. Thanks!
+11