# Invalid URL for markdown-it-bundle

**URL:** https://meta.discourse.org/t/invalid-url-for-markdown-it-bundle/248463
**Category:** Self-hosting
**Tags:** cdn, s3
**Created:** [December 10, 2022, 8:49am UTC](https://meta.discourse.org/t/invalid-url-for-markdown-it-bundle/248463 "2022-12-10T08:49:55Z")
**Posts on this page:** 1
**Showing post:** 10

<div class="post-metadata">

### Author: ![JustinBack](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/justinback/32/133266_2.png) [@JustinBack](https://meta.discourse.org/u/JustinBack)
#### Post date: [December 13, 2022, 8:34pm UTC](https://meta.discourse.org/t/invalid-url-for-markdown-it-bundle/248463/10 "2022-12-13T20:34:02Z")

</div>

UPDATE: I just checked the way markdown-it-bundle is embedded and executed the script\_asset\_path through the rail console (with slight modifications due to the missing request.env variable!)

![image](https://global.discourse-cdn.com/meta/optimized/4X/3/7/f/37fc6dea30046aee5f8a759c53edb5843f763bb9_2_690x40.png)

According to the script\_asset\_path, the asset url is correctly generated. Still not sure why this is happening.

EDIT:

It seems to be a known bug

> [@Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/configure-an-s3-compatible-object-storage-provider-for-uploads/148916/258):
>
> I’m also in this situation with an object store configured (minio) but no CDN. Is it a use case that could be supported ? From what I’m seeing so far in my tests there is only the markdown-it-bundle js file that is having issues as its pointing to the wrong URL - DISCOURSE\_HOSTNAME/DISCOURSE\_S3\_CDN\_URL/assets/markdown-it-bundle-HASH.br.js It actually looks lit a bug for this one, if I set DISCOURSE\_CDN\_URL variable, it still points to the wrong URL in this form DISCOURSE\_HOSTNAME/DISCOURSE\_CD…

EDIT 2:

I “fixed” it by using the most dirtiest workaround available. Hardcoding the Asset in the nginx config and redirecting it

```nginx
location ~ markdown-it-bundle-dcd9743077867b3a68d7b723130cb2711dc4c843b018d7bc609f868289402fef.(.*).js {
return 302 https://tosdr-forum.s3.jrbit.de/assets/markdown-it-bundle-dcd9743077867b3a68d7b723130cb2711dc4c843b018d7bc609f868289402fef.$1.js;
}

```

Did the trick, unless the asset is updated 🙂

---

_[View the full topic](https://meta.discourse.org/t/invalid-url-for-markdown-it-bundle/248463)._
