Help configuring Nginx on Fedora

Hello: I am trying use Nginx in a development environment. This is so I can emulate my intended production environment, but on my local workstation. Therefore, I want to set the web server up to run my pages / apps from my home directory on Fedora 43 Linux.

I have been working on this based on tutorials and I am aware of SELinux needing to be configured to allow the server to access a directory in my home folder (basically a public_html as the root for the server.

I believe the version is 1.20.x (whatever is the latest in the Fedora repositories).

Technically, it is going to be localhost only.

I changed the root under the / directive to /home/username/www and I get the 403 error. I also did try to update the SELinux stuff and even disabled temporarily to check. I am back to something being off in the configuration of Nginx.

The error log only shows the permission denied and no other info and the SELinux denial log shows nothing.

I also did check permissions on the folder.

I am completely at a loss on where to check so hopefully someone can help with what the nginx.conf should look like given the use case I have described.

Thanks,

Michael

1 Like

In order for nginx to access your www root, you’ll need to have the right permissions set, ignoring SELinux for now, so keep it disabled to get this bit working at least.

/home will likely be 755 which is fine.

drwxr-xr-x. 4 root root 33 Jul 30  2025 /home/

Your home directory may well be 700, which is not, at the very least it needs to be 701, i.e

drwx-----x

This will allow nginx to access your home directory, but not read/or modify it.

Now for your www directory, it probably wants to be 705, i.e.

drwx---r-x
1 Like

Thank you for the response. I will give that a try. I did figure out SELinux settings out, but did not change the pisix permissions on my user directory under the /home and that is probably why the 403 error persisted.

Appreciate this info.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.