问题描述
我使用@ angular/service-worker为angular4 Web应用程序生成了SW.更新ngsw-manifest.json以处理来自服务器的动态请求后脱机时(第一次加载后),我得到状态码:503 OK(来自ServiceWorker)".
I used @angular/service-worker to generate SW for an angular4 web app.after updating the ngsw-manifest.json to handle dynamic request from the serverI get "Status Code:503 OK (from ServiceWorker)" when offline (after first loading).
有什么想法吗?
推荐答案
您的问题与Web服务器或代理nginx上的[内容安全策略(CSP)]配置有关.由于您与nginx的连接正确,因此浏览器未启用PWA离线功能.
your problem is related with [Content Security Policy (CSP)] configuration on your web server or proxy nginx. Due you are connecting properly with nginx, the PWA offline feature is not enabled in your browser.
了解更多信息( https://content-security-policy.com/).
这篇关于503 ok(来自serviceWorker)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!