场景

nginx配置8081端口监听,通过查看日志,出现nginx: [emerg] bind() to 0.0.0.0:8081 failed (13: permission denied)异常。但是其它端口监听/访问正常。

解决方案

检查已开放端口

sudo semanage port -l | grep http_port_t

如果8081端口未出现在列表中,则执行:

sudo semanage port -a -t http_port_t  -p tcp 8081

参考

https://stackoverflow.com/questions/18480201/ubuntu-nginx-emerg-bind-to-0-0-0-080-failed-13-permission-denied

Logo

更多推荐