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: nginx: [error] invalid PID number ““ in “/run/nginx.pid“
- Nginx Startup Error: “/var/run/nginx/nginx.pid” failed” [How to Solve]
- Nginx Error: nginx: [emerg] the “ssl“ parameter requires ngx_http_ssl_module in /project/api/nginx.conf:
- [Solved] nginx: [error] open() “/usr/local/nginx/nginx.pid” failed (2: No such file or directory)
- Nginx Startup Error: Job for nginx.service failed because the control process exited with error code
- Nginx Error: [emerg] bind() to [::]:80 failed (98: Address already in use)
- Nginx Error: SSL: error:140AB18F:SSL routines:SSL_CTX_use_certificate:ee key too small
- [Solved] Nginx Restart Error: /run/nginx.pid failed (2: No such file or directory)
- [Solved] npm install Error: Error: EACCES: permission denied
- Restart and stop of nginx in Linux service
- Error: EACCES: permission denied, unlink ‘xxxx/xxxx/xxxx‘ [How to Solve]
- [Solved] Error during installation of nginx: Make: * * * [build] error 2
- [Solved] Ubuntu tab Error: _complete:96: bad math expression: operand expected at end of string
- How to Fix No default.conf file in conf.d after Installing Nginx
- [Solved] Nginx cannot access pictures on FTP Error: Whitelabel error page
- AFTER THE GIT SOURCE CODE IS INSTALLED, AN ERROR IS REPORTED /USR/BIN/GIT: NO SUCH FILE OR DIRECTORY
- Apache Cannot Start: SSL Library Error: -8181 Certificate has expired
- Docker -v Directory Mount (How to Use)
- How to Solve Error: “Hdaudio hdaudioc0d2: unable to bind codec”
- net::ERR_HTTP2_PROTOCOL_ERROR 200 [How to Solve]