When I check the browser inspector, URL for markdown-it-bundle is pointing to https:https://forum-beta-liiib-re.hot-objects.liiib.re/assets/markdown-it-bundle-9d939740bdeca330e5984bed41d12eab63736c1f720ab68e0c2a2d672c01adc2.br.js
It should not prefix the DISCOURSE_S3_CDN_URL with https: as its already there.
In the console I have the following error:
Loading failed for the <script> with source “https://discourse.liiib.re/https://forum-beta-liiib-re.hot-objects.liiib.re/assets/markdown-it-bundle-9d939740bdeca330e5984bed41d12eab63736c1f720ab68e0c2a2d672c01adc2.br.js”.
I guess my browser is redirecting the https:https://... URL to this one.
I have been trying to find, unsuccessfully, where this URL is set.
Well I’m not 100% sure as I don’t really have proper dev environment to test everything thoroughly, but it does not seem to come from there.
From what I saw, script_asset_path('markdown-it-bundle') is returning the right URL. And i think its used to build this meta HTML tag which looks fine.
It seems to be the js that is putting the wrong url with the https: prefix. I could not find where its coming from though.
Its only when I open the editor that I have a <script src="https:https://forum-beta-liiib-re.hot-objects.liiib.re/assets/markdown-it-bundle-9d939740bdeca330e5984bed41d12eab63736c1f720ab68e0c2a2d672c01adc2.br.js"</script> popping up.
So I tried to set DISCOURSE_S3_CDN_URL as a bucket subpath https://hot-objects.liiib.re/forum-beta-liiib-re and it is now working.
Do you think it would be reasonable to allow S3 CDN as a subdomain of S3 endpoint ?
In my case, which could be similar to other self-hosted setups, I’m not using an external CDN (nginx on top of minio can be considered as the CDN) so I don’t need to set it on another domain.
I actually setup the subdomain bucket because, I think, its required for discourse to manage uploads
Anyways it solved it and its working for me. Thanks for the help !