http://www.jb51.net/article/71384.htm

 

切记不要把项目放在/root下 会出现 nginx open() "" failed (13: Permission denied), client: 的错误

chmod 777 /root/xxxxxx 

即使修改了权限也不行,建议放在/home之下,新建自己的webapp目录。

修改nginx配置文件:(注意 配置静态文件的路径)

server {
  server_name static.naice.me; // 你的域名或者 ip
  root /www/static-web/static-web; // 你的克隆到的项目路径
  index index.html; // 显示首页
  location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|js|pdf|txt){
    root /www/static-web/static-web;
  } // 静态文件访问
}

https://segmentfault.com/a/1190000010487262

https://www.cnblogs.com/EasonJim/p/7806879.html

https://www.cnblogs.com/piscesLoveCc/p/5794926.html

https://blog.csdn.net/ljp1919/article/details/72833982

https://www.cnblogs.com/sz-jack/p/5206159.html

 

相关文章:

  • 2021-12-19
  • 2021-09-03
  • 2022-12-23
  • 2022-12-23
  • 2021-07-26
  • 2021-11-29
  • 2021-07-17
  • 2022-01-09
猜你喜欢
  • 2022-12-23
  • 2021-06-12
  • 2021-11-30
  • 2021-07-13
  • 2021-09-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案