# Avatar uploads broken on subfolder installs?

**URL:** https://meta.discourse.org/t/avatar-uploads-broken-on-subfolder-installs/100643
**Category:** Bug
**Created:** [October 26, 2018, 6:14pm UTC](https://meta.discourse.org/t/avatar-uploads-broken-on-subfolder-installs/100643 "2018-10-26T18:14:35Z")
**Posts on this page:** 1
**Showing post:** 13

<div class="post-metadata">

### Author: ![orenwolf](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/orenwolf/32/119529_2.png) [@orenwolf](https://meta.discourse.org/u/orenwolf)
#### Post date: [October 27, 2018, 5:48pm UTC](https://meta.discourse.org/t/avatar-uploads-broken-on-subfolder-installs/100643/13 "2018-10-27T17:48:14Z")

</div>

Smoking gun!

Found a reference in the weblogs to `POST /uploads.json`. Since this is a subdomain install, it should be `/forum/uploads.json`.

For reference, here are the **existing** app.yml changes that may be relevant, and are based off of posts here for [ip headers](https://meta.discourse.org/t/last-ip-address-and-action-dispatch-trusted-proxies/50098/3) and [Docker Subfolder support](https://meta.discourse.org/t/subfolder-support-with-docker/30507):

```plaintext
DISCOURSE_RELATIVE_URL_ROOT: /forum

```

(`<ip>` replaced below)

```nginx
  after_bundle_exec:
    # This is the magic to get IP numbers transmitted to Discourse
    - replace:
        filename: /etc/nginx/conf.d/discourse.conf
        from: "types {"
        to: |
          set_real_ip_from <ip>;
          set_real_ip_from <ip>;
          real_ip_header X-Forwarded-For;
          real_ip_recursive on;
          types {

```

```nginx
run:
  ## Settings to run from subfolder
  - exec:
      cd: $home
      cmd:
        - mkdir -p public/forum
        - cd public/forum && ln -s ../uploads && ln -s ../backups
  - replace:
     global: true
     filename: /etc/nginx/conf.d/discourse.conf
     from: proxy_pass http://discourse;
     to: |
        rewrite ^/(.*)$ /forum/$1 break;
        proxy_pass http://discourse;
  - replace:
     filename: /etc/nginx/conf.d/discourse.conf
     from: etag off;
     to: |
        etag off;
        location /forum {
           rewrite ^/forum/?(.*)$ /$1;
        }

```

My guess is that the specific avatar upload isn’t honouring `DISCOURSE_RELATIVE_URL_ROOT`.

---

_[View the full topic](https://meta.discourse.org/t/avatar-uploads-broken-on-subfolder-installs/100643)._
