这个问题可能是因为你使用的是history模式,而nginx服务器默认并不支持history模式。你可以尝试将nginx服务器配置文件中的以下内容添加到location块中,以支持history模式:
location / {
try_files $uri $uri/ /index.html;
}
当使用history模式时,nginx可能无法正确处理路由。为了解决这个问题,需要在nginx的配置文件中location块内添加try_files指令,设置为try_files$uri$uri//index.html,这将确保未找到具体文件时加载index.html,从而支持单页面应用的history模式路由。
这个问题可能是因为你使用的是history模式,而nginx服务器默认并不支持history模式。你可以尝试将nginx服务器配置文件中的以下内容添加到location块中,以支持history模式:
location / {
try_files $uri $uri/ /index.html;
}
1716
7124

被折叠的 条评论
为什么被折叠?