# How to upload files in root directory?

**URL:** https://meta.discourse.org/t/how-to-upload-files-in-root-directory/48388
**Category:** Support
**Created:** [9 Agosto 2016, 10:17am UTC](https://meta.discourse.org/t/how-to-upload-files-in-root-directory/48388 "2016-08-09T10:17:04Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![SMT](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@SMT](https://meta.discourse.org/u/SMT)
#### Post date: [9 Agosto 2016, 10:17am UTC](https://meta.discourse.org/t/how-to-upload-files-in-root-directory/48388/1 "2016-08-09T10:17:04Z")

</div>

Hi, I am trying to integrate onesignal push notifications with discourse and it requires to upload some SDK files in root directory - [Link](https://documentation.onesignal.com/docs/website-sdk-installation).

Can anyone guide me on how to upload these files in root directory?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [9 Agosto 2016, 2:14pm UTC](https://meta.discourse.org/t/how-to-upload-files-in-root-directory/48388/2 "2016-08-09T14:14:15Z")

</div>

Discourse have a plugin to get push notifications already:

[https://meta.discourse.org/t/discourse-push-notifications/46692?u=falco](https://meta.discourse.org/t/discourse-push-notifications/46692)

---

<div class="post-metadata">

### Author: ![Tom\_Newsom](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tom_newsom/32/115981_2.png) [@Tom\_Newsom](https://meta.discourse.org/u/Tom_Newsom)
#### Post date: [9 Agosto 2016, 2:35pm UTC](https://meta.discourse.org/t/how-to-upload-files-in-root-directory/48388/3 "2016-08-09T14:35:01Z")

</div>

> [@Falco](#):
>
> Discourse have a plugin to get push notifications already

But only for a subset of browsers and devices (and even then, not reliably)

@SMT - The “root” of your discourse instance lives inside the docker container. SSH in to your server and `cd /var/discourse` then `./launcher enter app`. Trouble is, anything you store here will be wiped when you run an update.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [9 Agosto 2016, 2:47pm UTC](https://meta.discourse.org/t/how-to-upload-files-in-root-directory/48388/4 "2016-08-09T14:47:23Z")

</div>

> [@Tom\_Newsom](#):
>
> But only for a subset of browsers and devices (and even then, not reliably)

One signal doesn’t support iOS also, so what’s the difference?

Also, discourse already supplies a manifest.json, so he will need to overthrown nginx/rails router. What are the pros?

---

<div class="post-metadata">

### Author: ![Tom\_Newsom](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tom_newsom/32/115981_2.png) [@Tom\_Newsom](https://meta.discourse.org/u/Tom_Newsom)
#### Post date: [9 Agosto 2016, 2:51pm UTC](https://meta.discourse.org/t/how-to-upload-files-in-root-directory/48388/5 "2016-08-09T14:51:20Z")

</div>

There was me taking the iOS badge on the Onesignal front page at face value 😃

---

<div class="post-metadata">

### Author: ![SMT](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@SMT](https://meta.discourse.org/u/SMT)
#### Post date: [13 Agosto 2016, 4:37am UTC](https://meta.discourse.org/t/how-to-upload-files-in-root-directory/48388/6 "2016-08-13T04:37:52Z")

</div>

Hi, yes but currently with this plugin, I can’t send a custom push to all users that’s why I need to integrate onesignal. Also with the plugin can we automatically subscribe all users for push notifications?

---

<div class="post-metadata">

### Author: ![Mario](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@Mario](https://meta.discourse.org/u/Mario)
#### Post date: [28 Ottobre 2016, 6:10am UTC](https://meta.discourse.org/t/how-to-upload-files-in-root-directory/48388/7 "2016-10-28T06:10:39Z")

</div>

did you solve the problem?

I want to add sendpulse files ([https://sendpulse.com/features/webpush](https://sendpulse.com/features/webpush)) to root directory but I have the same problem…

I have to:

1. Copy and paste code into your website template before the closing head tag

2. Download the setup files below for the Chrome browser support. Unzip the archive and upload the files into the top-level directory ( root , or ‘/’) of your website.

So…

cd /var/discourse then ./launcher enter app

**What next?**

---

<div class="post-metadata">

### Author: ![iamntz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamntz/32/114670_2.png) [@iamntz](https://meta.discourse.org/u/iamntz)
#### Post date: [16 Febbraio 2017, 5:06pm UTC](https://meta.discourse.org/t/how-to-upload-files-in-root-directory/48388/8 "2017-02-16T17:06:50Z")

</div>

Hey guys, a bit late at the party, but here is how _I_ solved this:

1. First step is to make your server to run nginx behind a proxy. You can find this [right here](https://meta.discourse.org/t/running-other-websites-on-the-same-machine-as-discourse/17247).

- `mkdir -p /var/www/discourse-static`

1. On the nginx config file (`/etc/nginx/sites-enabled/discourse.conf`), just **after** `location / {}` block, add the following:

```plaintext
location ~ (file1.txt|file2.json|file3.zip) {
  root /var/www/discourse-static;
}

```

Save and check the config by running `nginx -T`. If everything is fine (i.e. a wall of text will quickly scroll), then you can go on and `sudo service nginx restart`.

And that’s all.

* * *

> [@Falco](#):
>
> Discourse have a plugin to get push notifications already:

Discourse push plugin is a bit limited and requires users to actually _know_ where to look and what to look for in order to enable notifications.

---

<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: [25 Agosto 2022, 3:04am UTC](https://meta.discourse.org/t/how-to-upload-files-in-root-directory/48388/11 "2022-08-25T03:04:46Z")

</div>


