我想在非根域(https://ireading.site/test/)上服务单页应用程序(Vue)PWA网站。它工作正常,但未显示安装横幅。
我的nginx conf是
location /test {
root /var/www/;
index index.html index.htm;
add_header Service-Worker-Allowed /;
try_files $uri $uri/ /test;
}
我的manifest.json是
"start_url": "/test",
"name": "pwa-project",
"short_name": "pwa-project",
"icons": [
{
"src": "img/icons/android-chrome-192x192.png",
"type": "image/png",
"sizes": "192x192"
}
],
"display": "standalone"
文件结构为
/var/www/test
├── favicon.ico
├── index.html
├── lavas
│ └── routes.json
├── precache-manifest.4090d927e22f86d75520df465789c2ba.js
├── service-worker.js
├── static
│ ├── css
│ ├── img
│ ├── js
│ ├── manifest.json
│ └── workbox-v3.6.3
└── sw-register.js
如果我将其手动添加到我的android设备的桌面上,但未提示安装横幅,效果很好。
在Chrome审核User will not be prompted to Install the Web App
Failures: Service worker does not successfully serve the manifest's start_url, Timed out waiting for fetched start_url.
是否可以将其托管在子文件夹上并正确显示安装横幅?