# Service-worker redirection 403

**URL:** https://meta.discourse.org/t/service-worker-redirection-403/224096
**Category:** Self-hosting
**Created:** [April 12, 2022, 9:41pm UTC](https://meta.discourse.org/t/service-worker-redirection-403/224096 "2022-04-12T21:41:25Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [April 12, 2022, 9:41pm UTC](https://meta.discourse.org/t/service-worker-redirection-403/224096/1 "2022-04-12T21:41:25Z")

</div>

Hi, we are using Bunny CDN and see that error after last update (own hosted instance):

```plaintext
service-worker.js:1 Uncaught DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'https://CDN/javascripts/workbox/workbox-sw.js' failed to load.
    at https://NOTCDN/service-worker.js:1:14
(anonymous) @ service-worker.js:1

```

Related issue here:

> [@Failed to register Service Worker: Security Error because of redirect](https://meta.discourse.org/t/failed-to-register-service-worker-security-error-because-of-redirect/191832):
>
> Since the latest update we get the following JS errors re Service Worker in Chrome: The script resource is behind a redirect, which is disallowed. \_application-786bec8dbeba5dccf3118668436791948e535eb587456944e94e0724bc417b14.js:76435 Failed to register Service Worker: SecurityError: Failed to register a ServiceWorker for scope ('https://www.xxxxx.com/') with script ('https://www.xxxxxx.com/service-worker.js'): The script resource is behind a redirect, which is disallowed. We host …

But rebuild app not work for us ☹

---

<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: [April 13, 2022, 1:44am UTC](https://meta.discourse.org/t/service-worker-redirection-403/224096/2 "2022-04-13T01:44:23Z")

</div>

This usually means that your CDN is misconfigured. Can you share your instance URL ?

---

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [April 13, 2022, 1:51am UTC](https://meta.discourse.org/t/service-worker-redirection-403/224096/3 "2022-04-13T01:51:53Z")

</div>

Of course:

[https://comunidad.btcarg.com.ar](https://comunidad.btcarg.com.ar)

You can see the error message in browser console.

---

<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: [April 13, 2022, 1:59am UTC](https://meta.discourse.org/t/service-worker-redirection-403/224096/4 "2022-04-13T01:59:03Z")

</div>

Your CDN is definetly misconfigured. Every request becomes a redirect.

Example:

```plaintext
curl -I https://cdn-discourse.btcarg.com.ar/brotli_asset/google-universal-analytics-v3-706f1d28f0a97f67a47515c96189277240ec4940d968955042066d7873fd1fe8.js
HTTP/2 301
date: Wed, 13 Apr 2022 01:58:24 GMT
content-type: text/html
content-length: 178
location: https://comunidad.btcarg.com.ar/brotli_asset/google-universal-analytics-v3-706f1d28f0a97f67a47515c96189277240ec4940d968955042066d7873fd1fe8.js
server: BunnyCDN-BR1-788
cdn-pullzone: 130852
cdn-uid: 248d702c-77f7-4a11-a1e4-6493202be675
cdn-requestcountrycode: BR
cdn-proxyver: 1.02
cdn-requestpullsuccess: True
cdn-requestpullcode: 301
cdn-cachedat: 04/13/2022 01:58:24
cdn-edgestorageid: 788
link: <https://foro.btcarg.com.ar/brotli_asset/google-universal-analytics-v3-706f1d28f0a97f67a47515c96189277240ec4940d968955042066d7873fd1fe8.js>; rel="canonical"
cdn-status: 301
cdn-requestid: 8dc502d3ed8aec72124ecd76a0f63602
cdn-cache: MISS

```

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [May 13, 2022, 1:59am UTC](https://meta.discourse.org/t/service-worker-redirection-403/224096/5 "2022-05-13T01:59:44Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
