配置nginx以在web应用程序中提供manifest.json文件

配置nginx以在web应用程序中提供manifest.json文件,nginx,manifest,progressive-web-apps,Nginx,Manifest,Progressive Web Apps,在我的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 如果我在浏览器url中直接调用js

在我的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
如果我在浏览器url中直接调用json文件,则可以,但我的应用程序无法调用此文件,因为nginx返回401错误:

<link rel="manifest" href="/manifest.json">


如何在nginx中允许此文件?

在我的情况下,在添加crossorigin属性后,此错误得到解决:



您是否已将同一问题签入?非常感谢。这应该被接受为一个答案。