Images inside the post is not visible with Bitnami install

unsupported-install

(veryx) #1

Hi,

I have installed discourse for internal usage of my company.

When I opened it to internet, the forum works fine except that the images inside the post is not visible in internet.But the avatar is visible.

When I checked the image link, the url for the image shows the local ip and the avatar have the correct public ip. I am not sure whether I have missed something when opening the forum to internet.

So now I want to replace the ip of the image with the public ip if it is accessed from internet. How can I do that. I mean which file I have to edit for this.

Thank you in advance for your help.


(veryx) #2

Is my question clear or not?? why i did not get any reply?? I am waiting for it :frowning:


(Wes Osborn) #3

I think some screenshots of the broken images and relevant sections of the HTML source code would help folks that would like to assist with troubleshooting.

I believe most Discourse image uploads are for the relative URL path, so I wouldn’t think that changing the hostname should matter.

Speaking of hostnames, do you have any hostname assigned to your Discourse instance? It sounds like you might be just trying to access based on IP addresses only and I’m not sure if Discourse is designed to work that way.

Did you upload the image file itself to Discourse or did you just point the to an image file located somewhere else on the web (or your local intranet)?

You may also want to try Rebuilding the HTML for a post to see if that helps with the issue, that option is usually under the wrench menu on a post.


(Wes Osborn) #4

Also, if you’re adding images for the purposes of favicons and your site’s header, you should upload those to the prebuilt staff topic titled Assets for the forum design and then link to the URLs for those images for the rest of your site setup.


(veryx) #5

Thank you for your reply. I am not adding favicon or site header. I am just using upload while replying to a topic.

Also I am unable to upload screenshots, as it says new users cannot upload images.

I can view the images when I access it locally through the url. Kindly note I use different ports for accessing internally and externally.

When I give the inspect element on the broken image, the image src is ‘https://xxx.xxx.xxx::8080/uploads/default/312/f999a00deb298021.jpg’ which should be ‘https://xxx.xxx.xxx:8443/uploads/default/312/f999a00deb298021.jpg

When I click rebuilt HTML, the image appears for a second and vanishes.


Broken images inside posts
(Wes Osborn) #6

Are you using a docker based install? If yes, what is your DISCOURSE_HOSTNAME: in your app.yml file? If you’re using an IP there, you are likely to have trouble.

If you’re not using a docker based install, then I’m afraid it will be a bit more difficult to resolve this issue as I believe that docker installs are the only supported platform.


(Kane York) #7

Your problems all stem from the fact that Discourse needs to generate absolute URLs that point to itself.

Get yourself a .local domain name (or a real one), and then you won’t need to use weird ports, your web frontend will be able to correctly proxy the requests.


(veryx) #9

I have installed the discourse through the bitnami stacks. And I have given the ip address for the host name. Now I have replaced it with the domain name, restarted all servers and ran the script rebakeposts.sh. The images then appeared, but it was only till the page getting refreshed. When I open a new tab or refresh the current page, it vanishes again :disappointed:


(Jeff Atwood) #10

We do not support the Bitnami install here. We only support our official Docker based install.


(Wes Osborn) #11

I’d suggest you reach out to the bitnami support team for more information about why their installation methods might be broken for your specific use case.

If you elect to pick another hosting provider that supports docker based installs, the good news is that you can move your existing discourse data over to the new server following these instructions:


(veryx) #12

Thank you for your support. :bow: I have solved the issue through the bitnami forum.


(Sam Saffron) #13