Home  >  Q&A  >  body text

linux - nginx starts with non-root permissions

I want to start nginx with non-root permissions but the error failed (13: Permission denied). According to the information found on the Internet, I need to modify #user nobody in nginx.conf to: user root, and then reload it. But I follow I did it, but the error still failed (13: Permission denied). How to solve this? Another way is to give a 755 permission, but I am not allowed to use this method. Please guide me, thank you

为情所困为情所困2680 days ago1359

reply all(4)I'll reply

  • 我想大声告诉你

    我想大声告诉你2017-06-17 09:18:20

    Non-root users cannot listen to ports below 1024.

    Only two options:

    1. nginx.conf configuration user nobody; listen <1024+>;

    2. nginx.conf configures user nobody; listen 80; , and then starts it as root in the startup script or service. The worker will run as user nobody, and the master will run as root.

    reply
    0
  • 巴扎黑

    巴扎黑2017-06-17 09:18:20

    You can turn off selinux

    reply
    0
  • 漂亮男人

    漂亮男人2017-06-17 09:18:20

    Change to your user and group, not root

    reply
    0
  • 女神的闺蜜爱上我

    女神的闺蜜爱上我2017-06-17 09:18:20

    Services on ports below 1024 require root privileges to start.
    If you want to use an ordinary user to start, it is recommended to configure a sudo permission for the ordinary user.

    reply
    0
  • Cancelreply