# 301 redirects to incorrect domain

**URL:** https://meta.discourse.org/t/301-redirects-to-incorrect-domain/70196
**Category:** Support
**Created:** [16. September 2017 um 19:12 UTC](https://meta.discourse.org/t/301-redirects-to-incorrect-domain/70196 "2017-09-16T19:12:52Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![steve2507](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@steve2507](https://meta.discourse.org/u/steve2507)
#### Post date: [16. September 2017 um 19:12 UTC](https://meta.discourse.org/t/301-redirects-to-incorrect-domain/70196/1 "2017-09-16T19:12:52Z")

</div>

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](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/](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.

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [16. September 2017 um 19:16 UTC](https://meta.discourse.org/t/301-redirects-to-incorrect-domain/70196/2 "2017-09-16T19:16:40Z")

</div>

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

---

<div class="post-metadata">

### Author: ![steve2507](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@steve2507](https://meta.discourse.org/u/steve2507)
#### Post date: [16. September 2017 um 19:18 UTC](https://meta.discourse.org/t/301-redirects-to-incorrect-domain/70196/3 "2017-09-16T19:18:37Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [16. September 2017 um 19:20 UTC](https://meta.discourse.org/t/301-redirects-to-incorrect-domain/70196/4 "2017-09-16T19:20:31Z")

</div>

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

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [16. September 2017 um 22:42 UTC](https://meta.discourse.org/t/301-redirects-to-incorrect-domain/70196/5 "2017-09-16T22:42:17Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2. Oktober 2019 um 07:59 UTC](https://meta.discourse.org/t/301-redirects-to-incorrect-domain/70196/6 "2019-10-02T07:59:59Z")

</div>



---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [31. Mai 2023 um 02:08 UTC](https://meta.discourse.org/t/301-redirects-to-incorrect-domain/70196/7 "2023-05-31T02:08:19Z")

</div>



---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [31. Mai 2023 um 02:19 UTC](https://meta.discourse.org/t/301-redirects-to-incorrect-domain/70196/8 "2023-05-31T02:19:38Z")

</div>


