[Sovled] CentOS nginx 500 error: failed (13: Permission denied)

##

Viewing the nginx error log

vim  /usr/local/nginx/logs/error.log

####

2021/11/15 19:26:59 [crit] 14130#0: *4 stat() “/root/code/dist/index.html” failed (13: Permission denied), client: 192.168.111.1, server: localhost, request: “GET /favicon.ico HTTP/1.1”, host: “192.168.111.3:8001″, referrer: ” http://192.168.111.3:8001/ ”

##

Because I changed the directory where nginx accesses static files, and I used root to modify it
the nginx.conf configuration file should also indicate the user to use:

###

Similar Posts: