Hello fellow Fedora users: I am working with Fedora 43 KDE Edition and setting up my development environment.
The stack I have chosen is Vite, React, TailwindCSS and Nginx web server. Since this is a developer setup and Nginx is to test builds of the websites.
I have everything installed for supporting this environment. I want to move the root WWW directory from /var to /home/[user]/www. I can easily configure this in the Nginx configuration.
Where I need help is how to set SELinux to be able to “see” the user space directory.
Hello: I thought this was solved. But I am still getting the 403 error no matter what. I have done the mods in the nginx.conf and checked the nginx.conf.default files. The SELinux permissions appear to be correct. I tried changing the user to nginx on that directory, which does defeat the purpose why I am moving it… I want to modify files in the directory without having to do everything as ‘sudo’.
SInce I am sure SELinux is not the problem (or perhaps the context is still not correct), I need other ideas. I have looked at the nginx log and actually tail -f was used and tried to access my index.html again like 4 times and it doesn’t seem to matter.
I am not sure what else I can do. The error.log just says permission denied and really doesn’t give a clear indication of what might be causing this.
I have set the directory recursively back to my user. After each modification of the conf file for nginx I do restart the server.
Does nginx have permission to read the folder? Try changing the group for the folder to nginx. If your SELinux logs are empty then it’s just regular POSIX perms.
Hi guys: Thank you for all the help. I decided that since it is not good practice to allow http access to your home directory anyhow, that I would just revert the nginx configurations back to the default. I can always follow the Apache paradigm for where to put my site and then modify the configs once again for the root.
In production, it will be a cloud server or physical server that is not part of my machine anyhow and though it is an extra step, you can still test the deployment on my local box by copying the build file (I am using Vite build with React and TailwindCSS) to the proper webserver directory on the same box and test it. Thanks again for the help.