我们需要在Nginx的配置文件中修改以下内容(通常Nginx配置文件位置为/etc/nginx/nginx.conf):

server {
  # ...

  location / {
    # ...
    # 增加下列命令,index.html可换为项目中使用的其它文件名
    try_files $uri $uri/ /index.html;
  }
}

在修改后使用nginx -s reload命令加载修改后的配置即可。

来源https://blog.csdn.net/ghosind/article/details/108006554

用自己私人的服务测试吧

相关文章:

  • 2022-12-23
  • 2022-01-16
  • 2021-06-09
  • 2022-12-23
  • 2022-12-23
  • 2022-02-03
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-04
  • 2022-12-23
  • 2022-02-19
  • 2022-02-08
  • 2022-12-23
相关资源
相似解决方案