0

I'm facing below issue when i need to activate server block from nginx.conf. Can you check it with me please?


sudo systemctl status nginx.service

● nginx.service - nginx - high performance web server

Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Fri 2022-10-21 18:28:13 +03; 11s ago Docs: http://nginx.org/en/docs/ Process: 8582 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE) Main PID: 2609 (code=exited, status=0/SUCCESS)

.....internal system[1]: Starting nginx - high performance web server... .....internal nginx[8582]: nginx: [emerg] bind() to 0.0.0.0:8085 failed (13: Permission denied) ....internal system[1]: nginx.service: Control process exited, code=exited status=1 ....internal system[1]: nginx.service: Failed with result 'exit-code'. ... Failed to start nginx - high performance web server.

Zek
  • 1

1 Answers1

0

If you use a port bigger than 1024 with root privilege, but still got this problem, that's may be caused by SELinux. You can disable selinux and test.or give me permission for port.

Check this port, say 8085, in segange port

sudo semanage port -l | grep http_port_t

If 8085 doesn't exist in the port list, add it into segange port

sudo semanage port -a -t http_port_t  -p tcp 8085
Pandurang
  • 111
  • 1
  • 4