Image upload, relative path instead of full path

Hello,

When I upload an image on my Discourse, the image path is full not relative:

My question is, Is there any possibility to have the relative path /uploads/... instead of the full path ?

Unless you want to write a plugin for that, I’m pretty sure there’s no way to do that.

Why do you want these links to be relative?

1 Like

We use a SSH tunel to connect to our discourse from outside.

ext (external.com) -> int (example.com) but of course, all image are broken. With the relative path, there will be no problem.
In fact, why this is not relative path by default ?

That’s not a supported setup – Discourse needs to know the hostname it is running at. I’m pretty sure that there will be more breakage than just images if the hostname is wrong.

I you need outside access to Discourse, you’ll need to use a technique that allows you to access Discourse at the original domain name configured in app.yml, e.g. a VPN tunnel.

4 Likes

If you put the images on a CDN then your problem is gone :wink:

Damm simple. I juste add this in the config file:

DISCOURSE_CDN_URL: //externe.com:8883

And rebake all the post !

2 Likes