search

Home  >  Q&A  >  body text

macos - Permission issues in nginx -t test after nginx installation

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!

PHPzPHPz2754 days ago743

reply all(3)I'll reply

  • 大家讲道理

    大家讲道理2017-05-16 17:12:44

    You need to confirm whether the /usr/local/var/run/ directory and nginx.pid file have permissions.

    reply
    0
  • 黄舟

    黄舟2017-05-16 17:12:44

    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.

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-16 17:12:44

    Under normal circumstances, only root has access to /logs/nginx.pid. You can use ls -l to view it

    reply
    0
  • Cancelreply