301 redirects to incorrect domain

AI-generated summary

User steve2507 reported that after updating Discourse to 1.9.0.beta10, 301 redirects were incorrectly pointing to the internal hostname ‘xiblediscourse’ instead of the public domain ‘discuss.xible.io’, affecting both post links and asset loading (like the markdown plugin). This issue occurred despite direct links working fine. fefrei asked about the DISCOURSE_HOSTNAME setting in app.yml, prompting steve2507 to realize the nginx reverse proxy config was missing the line proxy_set_header Host $http_host;. After adding it, the issue was resolved. fefrei acknowledged the fix and moved the topic to Product Support. riking added that X-Forwarded-Proto and X-Forwarded-For headers should also be configured to ensure proper proxy behavior. The problem was ultimately a misconfigured reverse proxy, not a Discourse bug.

I udpated my discourse today and noticed that links that redirect, suddenly go to the wrong place.
Take for example: https://discuss.xible.io/t/57. That redirects to domain ‘xiblediscourse’ which is the internal hostname of my machine (whichs sits behind a reverse proxy). That link is not going to work.

Direct links such as https://discuss.xible.io/ work fine.

This also affects loading the markdown plugin. When creating a new post, xiblediscourse/assets/markdown-it-bundle-…js is loaded instead of the one hosted on discuss .xible.io

Anyone else experiencing this? I’m running 1.9.0.beta10.
Categorized this as a bug for now. Some links were shortened because I can only post 2 links as a newbie.

Thanks.

On your server, in the file /var/discourse/containers/app.yml, what is DISCOURSE_HOSTNAME set to?

Never mind, a reload of the nginx reverse proxy config was missing this line;

proxy_set_header Host $http_host;

@fefrei; thanks for the very, very fast response anyway!

Good catch, that sounds plausible. Thanks for reporting back! :slight_smile:
I’ve moved the topic to Support accordingly.

Make sure you also have X-Forwarded-Proto and X-Forwarded-For.