# Main domain used as hostname instead of DISCOURSE\_HOSTNAME for emoji path

**URL:** https://meta.discourse.org/t/main-domain-used-as-hostname-instead-of-discourse-hostname-for-emoji-path/69979
**Category:** Self-hosting
**Created:** [September 13, 2017, 3:50pm UTC](https://meta.discourse.org/t/main-domain-used-as-hostname-instead-of-discourse-hostname-for-emoji-path/69979 "2017-09-13T15:50:33Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![hellothere](https://avatars.discourse-cdn.com/v4/letter/h/9de053/32.png) [@hellothere](https://meta.discourse.org/u/hellothere)
#### Post date: [September 13, 2017, 3:50pm UTC](https://meta.discourse.org/t/main-domain-used-as-hostname-instead-of-discourse-hostname-for-emoji-path/69979/1 "2017-09-13T15:50:33Z")

</div>

Hi,

I have an installation up and running but have a problem with emoji image path.

I have used this guide: [discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md) and have used

```
./launcher rebuild app

```

after changing settings in app.yml

I may have initially configured

```
DISCOURSE_HOSTNAME: 'bar.com'

```

But layer changed to

```
DISCOURSE_HOSTNAME: 'foo.bar.com'

```

Say I have a main domain:

```
bar.com

```

and a subdomain:

```
foo.bar.com

```

which for some URI’s uses Apache’s ProxyPass, e.g. for [foo.bar.com](http://foo.bar.com):

```
...
ProxyPass "/" "http://localhost:8090/"
ProxyPassReverse "/" "http://localhost:8090/"
...

```

and in app.yml I have the following settings:

```
DISCOURSE_HOSTNAME: 'foo.bar.com'
DOCKER_USE_HOSTNAME: true

```

then everything is loaded as expected (including other images) except emoijis, e.g.:

```
:confetti_ball:

```

in which case it attempts to retrieve the image from the main domain:

```
GET https://bar.com/images/emoji/google_classic/confetti_ball.png

```

with a 404 response.

It appears that the `bar.com` is used instead of `foo.bar.com` as an absolute path in this particular situation, i.e. from the source code of the loaded page it refers respectively to a relative path

```
<meta name="twitter:image" content="/images/default-apple-touch-icon.png" />

```

and an absolute path

```
<p>Congratulations! <img src="//bar.com/images/emoji/google_classic/confetti_ball.png?v=5" title=":confetti_ball:" class="emoji" alt=":confetti_ball:"></p>

```

In the case of a relative path it works, but for the absolute path it doesn’t. And I don’t know how to change the absolute path 😕

BR

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [September 13, 2017, 4:15pm UTC](https://meta.discourse.org/t/main-domain-used-as-hostname-instead-of-discourse-hostname-for-emoji-path/69979/2 "2017-09-13T16:15:28Z")

</div>

You will need to do a remap

```
# ssh into your server
cd /var/discourse
./launcher enter app
discourse remap "bar.com" "foo.bar.com"

```

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 8, 2024, 12:44pm UTC](https://meta.discourse.org/t/main-domain-used-as-hostname-instead-of-discourse-hostname-for-emoji-path/69979/3 "2024-06-08T12:44:15Z")

</div>

This topic was automatically closed after 2459 days. New replies are no longer allowed.
