# Site Logo and Icons Break due to subfolder config

**URL:** https://meta.discourse.org/t/site-logo-and-icons-break-due-to-subfolder-config/115277
**Category:** Support
**Created:** [17 באפריל,‏ 2019,‏ 4:10am UTC](https://meta.discourse.org/t/site-logo-and-icons-break-due-to-subfolder-config/115277 "2019-04-17T04:10:33Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Amit\_yadav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/amit_yadav/32/138293_2.png) [@Amit\_yadav](https://meta.discourse.org/u/Amit_yadav)
#### Post date: [17 באפריל,‏ 2019,‏ 4:10am UTC](https://meta.discourse.org/t/site-logo-and-icons-break-due-to-subfolder-config/115277/1 "2019-04-17T04:10:33Z")

</div>

Hey guys,

Your work on discourse is great,  
Just need small help,

After running discourse for few days I am having trouble with setting logo, as it breaks after few days (404 error in console),  
All images in post working fine,

I can not upload again any logo,  
Delete, reset and upload again doesn’t work,  
at the same time Gravatar also stopped working,  
I am not using cdn to serve images,  
discourse is setup on subfolder using this post [Serve Discourse from a subfolder (path prefix) instead of a subdomain](https://meta.discourse.org/t/subfolder-support-with-docker/30507)

 ![site%20logo%20breaks](https://global.discourse-cdn.com/meta/original/3X/4/d/4d255eaa6b823d2f6f9b8abd6d8aa696cd7324ed.jpeg)

> **[Latest Windows & Android How-Tos, Game Codes & Word Game Tips - TheTechBasket...](https://www.thetechbasket.com/?ref=thetechbasket&path)**
>
> Latest Posts Crossword Crossword Crossword Crossword Pinned Posts Android Windows Internet Trending Wallpapers Apple

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [17 באפריל,‏ 2019,‏ 4:52am UTC](https://meta.discourse.org/t/site-logo-and-icons-break-due-to-subfolder-config/115277/2 "2019-04-17T04:52:50Z")

</div>

Any ideas @tgxworld?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [17 באפריל,‏ 2019,‏ 5:36am UTC](https://meta.discourse.org/t/site-logo-and-icons-break-due-to-subfolder-config/115277/3 "2019-04-17T05:36:11Z")

</div>

Probably better if @david looks at this cause he is in the middle of a revamp here.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [17 באפריל,‏ 2019,‏ 9:15am UTC](https://meta.discourse.org/t/site-logo-and-icons-break-due-to-subfolder-config/115277/4 "2019-04-17T09:15:29Z")

</div>

> [@Amit\_yadav](#):
>
> at the same time Gravatar also stopped working

This suggests there is an issue bigger than just site logos. Are you seeing any errors in `/logs`? What kind of server are you running Discourse on? Do you have available disk space?

---

<div class="post-metadata">

### Author: ![Amit\_yadav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/amit_yadav/32/138293_2.png) [@Amit\_yadav](https://meta.discourse.org/u/Amit_yadav)
#### Post date: [17 באפריל,‏ 2019,‏ 9:32am UTC](https://meta.discourse.org/t/site-logo-and-icons-break-due-to-subfolder-config/115277/5 "2019-04-17T09:32:48Z")

</div>

Right now /logs are empty,  
16 gb available disk space using NGINX server,

We don’t have enough traffic so we are on 5$ DO droplet Ubuntu 18.10 x64

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [17 באפריל,‏ 2019,‏ 10:48am UTC](https://meta.discourse.org/t/site-logo-and-icons-break-due-to-subfolder-config/115277/6 "2019-04-17T10:48:09Z")

</div>

What happens if you try and re-upload a logo?

---

<div class="post-metadata">

### Author: ![Amit\_yadav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/amit_yadav/32/138293_2.png) [@Amit\_yadav](https://meta.discourse.org/u/Amit_yadav)
#### Post date: [17 באפריל,‏ 2019,‏ 10:50am UTC](https://meta.discourse.org/t/site-logo-and-icons-break-due-to-subfolder-config/115277/7 "2019-04-17T10:50:03Z")

</div>

uploading 100% then blank,

---

<div class="post-metadata">

### Author: ![Amit\_yadav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/amit_yadav/32/138293_2.png) [@Amit\_yadav](https://meta.discourse.org/u/Amit_yadav)
#### Post date: [17 באפריל,‏ 2019,‏ 10:53am UTC](https://meta.discourse.org/t/site-logo-and-icons-break-due-to-subfolder-config/115277/8 "2019-04-17T10:53:57Z")

</div>

Now my /logs have few errors

```
Deprecation notice: The flags webhook is deprecated. Please use reviewable instead. 
At /var/www/discourse/config/initializers/012-web_hook_events.rb:82:in `block (2 levels) in <top (required)>`

```

6 `Webhook event failed: Connection refused - connect(2) for 172.17.0.2:443 (Errno::ECONNREFUSED)`

6 ` Errno::ECONNREFUSED (Failed to open TCP connection to www.thetechbasket.com:443 (Connection refused - connect(2) for "www.thetechbasket.com" port 443)) /usr/local/lib/ruby/2.6.0/net/http.rb:949:in rescue in block in connect'`

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [17 באפריל,‏ 2019,‏ 11:11am UTC](https://meta.discourse.org/t/site-logo-and-icons-break-due-to-subfolder-config/115277/9 "2019-04-17T11:11:47Z")

</div>

Try going to the rails console

```plaintext
/var/discourse/launcher enter app
rails c

```

and then run

```plaintext
SiteSetting.logo

```

Do you get anything returned?

---

<div class="post-metadata">

### Author: ![Amit\_yadav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/amit_yadav/32/138293_2.png) [@Amit\_yadav](https://meta.discourse.org/u/Amit_yadav)
#### Post date: [17 באפריל,‏ 2019,‏ 12:27pm UTC](https://meta.discourse.org/t/site-logo-and-icons-break-due-to-subfolder-config/115277/10 "2019-04-17T12:27:37Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/3X/6/9/69c1f29793533aa350b27293199e4dd40e3762db.png)

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [17 באפריל,‏ 2019,‏ 1:00pm UTC](https://meta.discourse.org/t/site-logo-and-icons-break-due-to-subfolder-config/115277/11 "2019-04-17T13:00:36Z")

</div>

Hmmm, that looks correct. But the URL it’s pointing to returns a 404: [https://www.thetechbasket.com/community/uploads/default/original/1X/318d1773f36e3e13192b2007fffa029d71fad86c.png](https://www.thetechbasket.com/community/uploads/default/original/1X/318d1773f36e3e13192b2007fffa029d71fad86c.png)

Have you done anything which might have deleted files from your server? (Normally they would be under `/var/discourse/shared/standalone/uploads/default`).

Anyway, to try and recover, you can delete the upload record from the database and upload again. So in this case, run `Upload.find(10).destroy!` from the rails console.

---

<div class="post-metadata">

### Author: ![Amit\_yadav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/amit_yadav/32/138293_2.png) [@Amit\_yadav](https://meta.discourse.org/u/Amit_yadav)
#### Post date: [17 באפריל,‏ 2019,‏ 1:51pm UTC](https://meta.discourse.org/t/site-logo-and-icons-break-due-to-subfolder-config/115277/12 "2019-04-17T13:51:16Z")

</div>

Ok now logo uploaded and working fine for now,  
but I can not upload other logo and icons,

I don’t see any new files in `/var/discourse/shared/standalone/uploads/default`

`original/1X` contains two images but not accessible on `/community/uploads/default/original/1X/`

**Error**

```
`ActionController::MissingFile (Cannot read file /var/www/discourse/public/community/uploads/default/original/1X/318d1773f36e3e13192b2007fffa029d71fad86c.png)
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/actionpack-5.2.2.1/lib/action_controller/metal/data_streaming.rb:69:in `send_file'

```

**/var/www/discourse folder does not exist**

 ![var%20www](https://global.discourse-cdn.com/meta/original/3X/c/9/c93d42b0c4fcb908cf158711c93e0b8c3cebd6ff.jpeg)

Actual structure of discourse on my server is like this

**/var/www/thetechbasket.com/discourse/**

 ![main%20discourse%20files](https://global.discourse-cdn.com/meta/original/3X/f/0/f06c1d955e208bd6f3744fa4ba2c470b3c84a63a.jpeg)

**/var/discourse/**

 ![discourse%20shared%20files](https://global.discourse-cdn.com/meta/original/3X/7/5/759d467b8c9254527d3b417d8e0ea1e03476fe90.jpeg)

Is folder upload folder not mapped correctly? or permission issue?

---

<div class="post-metadata">

### Author: ![Amit\_yadav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/amit_yadav/32/138293_2.png) [@Amit\_yadav](https://meta.discourse.org/u/Amit_yadav)
#### Post date: [17 באפריל,‏ 2019,‏ 2:04pm UTC](https://meta.discourse.org/t/site-logo-and-icons-break-due-to-subfolder-config/115277/13 "2019-04-17T14:04:18Z")

</div>

Actually you can say right now upload functionality is totally broken,  
on upload image path is created but it can not be accessed (404)

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [17 באפריל,‏ 2019,‏ 2:04pm UTC](https://meta.discourse.org/t/site-logo-and-icons-break-due-to-subfolder-config/115277/14 "2019-04-17T14:04:50Z")

</div>

Why isn’t discourse installed at `/var/discourse`?

How was this installed?

---

<div class="post-metadata">

### Author: ![Amit\_yadav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/amit_yadav/32/138293_2.png) [@Amit\_yadav](https://meta.discourse.org/u/Amit_yadav)
#### Post date: [17 באפריל,‏ 2019,‏ 2:06pm UTC](https://meta.discourse.org/t/site-logo-and-icons-break-due-to-subfolder-config/115277/15 "2019-04-17T14:06:31Z")

</div>

Discourse installed at  
`/var/www/thetechbasket.com/discourse/`

following this post

> [@Serve Discourse from a subfolder (path prefix) instead of a subdomain](https://meta.discourse.org/t/subfolder-support-with-docker/30507):
>
> warning Discourse Official Statement about Subfolder setup We support subfolder setups for our hosted customers at the enterprise level and up. Due to heavy technical setup complexity we strongly recommend you do not use this setup unless you are very experienced in custom subfolder setups. It is critical you have a deep understanding of NGINX setup in the Discourse Docker container Secure original IP forwarding using custom headers in the proxy chain Rate limiting in front proxy server I…

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [17 באפריל,‏ 2019,‏ 2:07pm UTC](https://meta.discourse.org/t/site-logo-and-icons-break-due-to-subfolder-config/115277/16 "2019-04-17T14:07:48Z")

</div>

And where does that tell you not to install it in /var/discourse?

Remapping is carried out by nginx, which is what that guide covers.

Discourse still needs to be installed in [the normal way](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md)

---

<div class="post-metadata">

### Author: ![Amit\_yadav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/amit_yadav/32/138293_2.png) [@Amit\_yadav](https://meta.discourse.org/u/Amit_yadav)
#### Post date: [17 באפריל,‏ 2019,‏ 2:13pm UTC](https://meta.discourse.org/t/site-logo-and-icons-break-due-to-subfolder-config/115277/17 "2019-04-17T14:13:24Z")

</div>

Ok Thats my mistake,

What should I do now to move discourse to correct location with current settings,

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [17 באפריל,‏ 2019,‏ 2:15pm UTC](https://meta.discourse.org/t/site-logo-and-icons-break-due-to-subfolder-config/115277/18 "2019-04-17T14:15:43Z")

</div>

Out of curiosity why are you going through the pain of a subfolder install?

> [@Serve Discourse from a subfolder (path prefix) instead of a subdomain](https://meta.discourse.org/t/serve-discourse-from-a-subfolder-path-prefix-instead-of-a-subdomain/30507/1):
>
> It is critical you have a deep understanding of
> 
> - NGINX setup in the Discourse Docker container
> - Secure original IP forwarding using custom headers in the proxy chain
> - Rate limiting in front proxy server
> 
> If this all sounds odd and strange to you **we strongly recommend** you avoid this setup.

This seems to be very relevant to your situation. A lack of understanding of the concepts here is going to keep coming back and biting you.

---

<div class="post-metadata">

### Author: ![Amit\_yadav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/amit_yadav/32/138293_2.png) [@Amit\_yadav](https://meta.discourse.org/u/Amit_yadav)
#### Post date: [17 באפריל,‏ 2019,‏ 2:30pm UTC](https://meta.discourse.org/t/site-logo-and-icons-break-due-to-subfolder-config/115277/19 "2019-04-17T14:30:03Z")

</div>

Actually you already know why everyone wants to have community on subdirectory instead of subdomain,  
subdomain is treated as separate site in SERP and we don’t want to manage two sites,

I think for now I am going to stick to subdirectory,

So tell me how I can do it.

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [17 באפריל,‏ 2019,‏ 2:32pm UTC](https://meta.discourse.org/t/site-logo-and-icons-break-due-to-subfolder-config/115277/20 "2019-04-17T14:32:13Z")

</div>

You’ve already made it clear that you have:

- A broken Discourse installation, having deviated from the install guide
- Gaps in your technical knowledge in implementing the subfolder install.

Google make it quite clear that subfolders and subdomains are treated equally - as your don’t currently have the expertise to install this you probably need to consider making a post in the #Marketplace.

And bear in mind that complications do arise with subfolders and updates - you’re going to need to retain someone to help you maintain it down the line.

[Next page](https://meta.discourse.org/t/site-logo-and-icons-break-due-to-subfolder-config/115277.md?page=2)
