BoldMinded acquires Ansel, support ending for all add-ons. BoldMinded acquires Ansel, support ending for all add-ons. Read More →
Support has been discontinued. Issues remain available as an archive. Support has been discontinued. Issues remain available as an archive.
Server responded with 0 code — CORS issue on multisite
#179 opened by Torch
Description
I have 3 sites on one install, I'm getting error on upload to ansel field because of a CORS issue. I only want one domain login (the main site url) to manage all 3 sites. Ansel uploads only seem to work if admin is logged into the cp at the url for the site its trying to upload files for.
Ideally, I'd like one login url and be able to manage each sites ansel fields. But this doesn't seem possible. Any way around this? Or can you confirm the issue so I can find another solution? Thanks!
Replies
- TJ Draper
Replied 6/4/2020 8:49 AM, Edited 6/4/2020 9:32 AM
Unfortunately, Ansel doesn’t have any control over CORS headers. If you upload a file to another site and then Ansel tries to load the resulting image from the other domain and the proper CORS headers aren’t set up, Ansel will not function properly because it will not be able to load the image.
There are two possible solutions that I can think of:
- Whitelist all the domains within the MSM setup for CORS access so each domain in your MSM setup is allowed to access resources across the domains (https://stackoverflow.com/a/1850482)
- Make sure the images are available at Control Panel domain and make sure your config is dynamically setting the URL to that domain depending on which site you are on
- Torch
Replied 6/4/2020 9:32 AM
Much appreciated TJ, I'll go about one of those solutions. Thanks for the quick response as well.