问题描述

在nginx上部署vue项目,访问页面显示500


原因分析:

查看nginx错误日志,显示:rewrite or internal redirection cycle while internally redirecting to "/index.html", client: xxx.xxx..xxx.145, server: localhost, request: "GET /favicon.ico HTTP/1.0", host: "xxx.xxx..xxx.145:8080", referrer: "http://xxx.xxx..xxx.145/"

原因可能有两个:

  1. 找不到文件路径
  2. 文件路径没有访问权限

解决方案:

依据路径能找到部署文件,那就是访问权限问题。
nginx.conf 文件中user一行,原来是 user nginx 改为 user root,即可访问页面。
在这里插入图片描述

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐