Preview pane uses local docker container IP address

It looks like the preview pane when creating a new topic is broken. Inspecting via the browser console says the markdown-it-bundle…js script fails to load because of a timed out connection. Unlike other assets, this is being looked up through the IP address rather than the domain name:

I’d guess this is failing because the URL needs a port number if using the IP address.

Deployment Information:
I am using a single node docker deployment of discourse. I have set these 3 variables in container/app.yml

  2. DISCOURSE_HOST_IP: {docker-host-IP}

That looks weird. With Google, I can only find 4 references to this variable in the whole internet, and one of them is this thread :wink:

Can you try removing that and rebuilding? If this doesn’t fix it: Are you behind a reverse proxy?


After reading your post, and your question on reverse proxy. I quickly checked my Discourse instance with IP address of docker-host:PORT. I found that preview panel works as expected in this case.

I could say it is not working as expected, when I am accessing via domain name that lands on docker-host and reverse proxied to specific port using nginx. Can you suggest what maybe causing this?

Here is the configuration of nginx for this domain.

server {
listen 80;
server_name domain_name;
location {

Aha, your nginx configuration is missing critical headers! Please look at this guide:

Once you add the following lines to your configuration and reload it, problem should be resolved :slight_smile:


Thanks @fefrei. That was helpful, and solved the problem.

Just to mention here, I have setup nginx as container on same host which is doing the reverse proxy.