nginx发布静态网页

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

扫描二维码关注公众号,回复: 1042782 查看本文章

猜你喜欢

转载自www.cnblogs.com/hellojesson/p/9093719.html