在我的Web应用中,开发控制台中出现此错误:
GET /manifest.json 401 (Unauthorized)
manifest.json:1 Manifest: Line: 1, column: 1, Unexpected token.
login:1 Site cannot be installed: the manifest could not be fetched, is empty, or could not be parsed
如果我直接在浏览器网址中调用json文件,可以,但是我的应用无法调用此文件,因为nginx返回401错误:
<link rel="manifest" href="/manifest.json">
如何在nginx中允许此文件?
答案 0 :(得分:2)
就我而言,添加了crossorigin属性后,此错误已解决:
<link rel="manifest" href="./manifest.json" crossorigin="use-credentials">