Integrating OneSignal (service worker files)

Hi All, I have setup a new blog using the latest version of Ghost, Ubuntu, Node.js etc. I am a bit of a novice when it comes to managing my server and am using a DigitalOcean Droplet. I am trying to integrate OneSignal (notification service). They require that I upload 2 .js files to the root directory of my server which (i think) is /vars/www/domain/htdocs/. I have tried several other potential root directories, however when i upload any files there I get 404 not found, so either that is the wrong root location or Ghost is not allowing access to the files. Please help. Thanks!

Have you tried uploading the files in your theme?

No, because i did not expect that the root web folder would be inside my theme folder?

See here:

Requirements for file structure and naming
The OneSignal service worker files (OneSignalSDKWorker.js and OneSignalSDKUpdaterWorker.js) should be added to your site in a way that meets these requirements:

Do not rename the files (keep upper case letters). If you need to rename them, see Customizing Service Worker Integration
The files should be served with a content-type of application/javascript
The files should be served from the top-level root of your site origin. If you need to place these files in a subdirectory, or cannot upload files to the server, see Customizing Service Worker Integration.
The files must point to the same site origin (your site domain). Pointing to a service worker on a different origin is not allowed.
For example:
If you visit your service worker file’s URL, you should see a page that looks like this example:

Unless Ghost is living on a subdomain (, if you need to place files in the root, the best way is by placing files into the theme.

Since all requests are proxied to Ghost, the file system structure won’t 1:1 match the URL structure you see in Ghost.

OK i tried putting it in the root folder of my theme but still cannot access the file by going to

I placed the test file here:

In my theme’s root folder where all the .rbs files are.

I just tried it on a production server and it worked :confused: I think there’s some context missing…

If you’re looking for some help, it’s important to provide as much context as possible so that people are able to assist you. Try to always mention:

  • What’s your URL? This is the easiest way for others to debug your issue
  • What version of Ghost are you using?
  • What configuration?
  • What browser?
  • What errors or information do you see in the console?
  • What steps could someone else take to reproduce the issue you’re having?