The system is mac OS 10.11.8. The xiaohan user installed nginx through brew install nginx in the terminal. The current problem is that the nginx -t test fails under the xiaohan user status. The test can only succeed with the root user permissions. But the browser can access localhost:8080
normally
Already has full permissions on nginx
vim Check the nginx.conf file and the first line is
#user nobody;
Just remove # or change it to
user xiaohan;
, it doesn’t work, please give me some advice, thank you!
You need to confirm whether the /usr/local/var/run/ directory and nginx.pid file have permissions.
I guess your user xiaohan does not have permission to the file /logs/nginx.pid, so when you execute nginx -t under the user xiaohan, Permission denied is reported.
Under normal circumstances, only root has access to /logs/nginx.pid. You can use
ls -l
to view it