# New discourse install has broken image URLs to localhost

**URL:** https://meta.discourse.org/t/new-discourse-install-has-broken-image-urls-to-localhost/107992
**Category:** Self-hosting
**Tags:** unsupported-install
**Created:** [January 31, 2019, 4:29am UTC](https://meta.discourse.org/t/new-discourse-install-has-broken-image-urls-to-localhost/107992 "2019-01-31T04:29:41Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![xxxhuizhang](https://avatars.discourse-cdn.com/v4/letter/x/9dc877/32.png) [@xxxhuizhang](https://meta.discourse.org/u/xxxhuizhang)
#### Post date: [January 31, 2019, 4:29am UTC](https://meta.discourse.org/t/new-discourse-install-has-broken-image-urls-to-localhost/107992/1 "2019-01-31T04:29:41Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/3X/d/c/dc2c1256f399f1069b32808d86c21cba158a6a4d.png)

 ![image](https://global.discourse-cdn.com/meta/original/3X/8/0/80fdf304afd95540b1ffdcbd1bd353bc515c258b.png)

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/5/e553fb8bfb9e2dcb7e3859494397ea876176b1b9.png)

this is my nginx conf

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/b/eb752ead2c5defcc7869262fb1753c63e565d875.png)

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [January 31, 2019, 5:10am UTC](https://meta.discourse.org/t/new-discourse-install-has-broken-image-urls-to-localhost/107992/2 "2019-01-31T05:10:15Z")

</div>

You’ll have to set `Sitesetting.port = 4000`

---

<div class="post-metadata">

### Author: ![xxxhuizhang](https://avatars.discourse-cdn.com/v4/letter/x/9dc877/32.png) [@xxxhuizhang](https://meta.discourse.org/u/xxxhuizhang)
#### Post date: [January 31, 2019, 5:14am UTC](https://meta.discourse.org/t/new-discourse-install-has-broken-image-urls-to-localhost/107992/4 "2019-01-31T05:14:28Z")

</div>

I’m new to rails . which file write this set ?  
I run discourse -\> bundle exec rails server -p 4000 .

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [January 31, 2019, 5:17am UTC](https://meta.discourse.org/t/new-discourse-install-has-broken-image-urls-to-localhost/107992/5 "2019-01-31T05:17:03Z")

</div>

This should do the trick.

```plaintext
rails console
SiteSetting.port = 4000

```

---

<div class="post-metadata">

### Author: ![xxxhuizhang](https://avatars.discourse-cdn.com/v4/letter/x/9dc877/32.png) [@xxxhuizhang](https://meta.discourse.org/u/xxxhuizhang)
#### Post date: [January 31, 2019, 5:31am UTC](https://meta.discourse.org/t/new-discourse-install-has-broken-image-urls-to-localhost/107992/7 "2019-01-31T05:31:52Z")

</div>

after set that my website dont work . should i change other setting , nginx ??

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [January 31, 2019, 6:00am UTC](https://meta.discourse.org/t/new-discourse-install-has-broken-image-urls-to-localhost/107992/8 "2019-01-31T06:00:55Z")

</div>

Are you using this in development or a docker based install?

---

<div class="post-metadata">

### Author: ![xxxhuizhang](https://avatars.discourse-cdn.com/v4/letter/x/9dc877/32.png) [@xxxhuizhang](https://meta.discourse.org/u/xxxhuizhang)
#### Post date: [January 31, 2019, 6:24am UTC](https://meta.discourse.org/t/new-discourse-install-has-broken-image-urls-to-localhost/107992/9 "2019-01-31T06:24:46Z")

</div>

i’m not using docker .

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [January 31, 2019, 6:25am UTC](https://meta.discourse.org/t/new-discourse-install-has-broken-image-urls-to-localhost/107992/10 "2019-01-31T06:25:36Z")

</div>

Sorry we only provide support for our official docker based installs. My guess here is that your nginx proxy has not been configured correctly.

---

<div class="post-metadata">

### Author: ![xxxhuizhang](https://avatars.discourse-cdn.com/v4/letter/x/9dc877/32.png) [@xxxhuizhang](https://meta.discourse.org/u/xxxhuizhang)
#### Post date: [January 31, 2019, 6:29am UTC](https://meta.discourse.org/t/new-discourse-install-has-broken-image-urls-to-localhost/107992/11 "2019-01-31T06:29:21Z")

</div>

how configured correctly ? i search a lot but did’t sloved . so i come here . any suggest to nginx config ?

---

<div class="post-metadata">

### Author: ![xxxhuizhang](https://avatars.discourse-cdn.com/v4/letter/x/9dc877/32.png) [@xxxhuizhang](https://meta.discourse.org/u/xxxhuizhang)
#### Post date: [January 31, 2019, 6:37am UTC](https://meta.discourse.org/t/new-discourse-install-has-broken-image-urls-to-localhost/107992/12 "2019-01-31T06:37:35Z")

</div>

thank for your help .
