本文共 615 字,大约阅读时间需要 2 分钟。
配置好nginx,react build完毕,开开心心去service nginx restart
,
去查看nginx log,发现这么一行
2017/12/29 17:41:43 [crit] 30755#0: *4 stat() "/home/fgadmin/xxxx-web/build/index.html" failed (13: Permission denied), client: 112.80.52.134, server: localhost, request: "GET / HTTP/1.1", host: "106.14.2.233"
再查看nginx.conf的属性
[user@sdsfsdfsdfsdfsd conf]$ ls -l nginx.conf
-rw-r--r-- 1 root root 2717 Dec 29 19:40 nginx.conf
看来是缺少权限,修改nginx.conf,在第一行加上user root
#user nobody;user root;worker_processes 1;#error_log logs/error.log;#error_log logs/error.log notice;#error_log logs/error.log info;...............
搞定手工
转载地址:http://qllji.baihongyu.com/