nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied) This is because port 80 can only be started by the root user, so just let the non-root user use port 80.
The solution is as follows:
# Set CAP_NET_BIND_SERVICE capability for the specified program
$ setcap cap_net_bind_service=+eip /path/to/application
The tests are as follows:
# sudo setcap cap_net_bind_service=+eip /usr/local/nginx/sbin/nginx
It’s OK to start nginx again.
/usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx.conf
Read More:
- Nginx Error: [emerg] bind() to [::]:80 failed (98: Address already in use)
- Nginx Startup Error: “/var/run/nginx/nginx.pid” failed” [How to Solve]
- [Solved] nginx: [error] open() “/usr/local/nginx/nginx.pid” failed (2: No such file or directory)
- Nginx error: nginx: [error] invalid PID number ““ in “/run/nginx.pid“
- [Solved] Nginx Restart Error: /run/nginx.pid failed (2: No such file or directory)
- Nginx Error: nginx: [emerg] the “ssl“ parameter requires ngx_http_ssl_module in /project/api/nginx.conf:
- Nginx Startup Error: Job for nginx.service failed because the control process exited with error code
- [Solved] WSL Ubuntu error: Access folder permission denied
- Nginx Error: Swap file “/etc/nginx/.nginx.conf.swp“ already exists
- [Solved] npm install Error: Error: EACCES: permission denied
- Error: EACCES: permission denied, unlink ‘xxxx/xxxx/xxxx‘ [How to Solve]
- [Solved] Window Redis Service Failed to Startup: bind No error
- How to Solve Error: “Hdaudio hdaudioc0d2: unable to bind codec”
- Restart and stop of nginx in Linux service
- How to Fix No default.conf file in conf.d after Installing Nginx
- [Solved] Nginx Startup Error: directive is not allowed here in
- [Solved] Nginx cannot access pictures on FTP Error: Whitelabel error page
- Nginx Error: SSL: error:140AB18F:SSL routines:SSL_CTX_use_certificate:ee key too small
- Common configuration methods of nginx
- [Solved] Error during installation of nginx: Make: * * * [build] error 2