It works when I don’t have any server blocks, but once I do, it’s either binding to port 80 or 443 and afaik those require root access and sudo isn’t cutting it.
How are you configuring the system and installing nginx? By default, nginx and httpd are both setup to be allowed to fork processes from root to nginx/apache and run on port 80 and 443 without any intervention.
I’m using Ansible but I’m not doing anything crazy (I think). I’m installing the stable package, 1.24.0.
It works fine until I add the server block. If I delete that, I’m able to run the command. Even a block like
server {
}
stops it working, with no other settings changed. I’ve put that into the nginx.conf file just in case it was something like the symlink in sites-enabled messing it up, but no joy.
I have a simple HTML file and that is getting served fine, so Nginx should have the right permissions for that.
Oh and I disabled SELinux as it’s a test server I’m playing with. It worked then.
It also worked after I reset the system and didn’t change my SELinux data, so it was left as
id -Z
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
I’m running
sudo journalctl -f
and then triggering the error but that’s not showing anything about it. I’m getting some errors from setroubleshoot for other things, though.
I guess it’s a tricky one. I’ll try the RedHat community and Reddit as well and I’ll update this if I’m able to reach a solution, just in case anyone else comes across this