I was following a tutorial where a linux user is created with useradd instead of adduser. My question is if I need to be logged in as the user with permissions on the staticfiles folders when running ‘service nginx start’ and if this is how the uid of nginx is set to match the uid required in the permissions of the folders.
I’m asking because in the tutorial you don’t log in with the user, you just create it, set all the permissions to it and make this the user in the supervisorctl config files for gunicorn. However it seems like this is a reason why nginx static files and logs aren’t working because ‘service nginx start’ is run with whatever user you’re doing the tutorial with not this user with the permissions.
Does every one run nginx with ‘service nginx start’ or is it also started from supervisorctl or another service where you specify the user to run it?
I’ve previously got around this issue by running nginx from my local user, however with useradd, it seem it’s not the same type of user as adduser (Useradd vs Adduser: What's the Difference?). So before troubleshooting the user or creating a new user the other way with adduser I just wanted to check the standard way to make the nginx uid match the folder permission and if I can do it without logging in as that user. Thanks
Edit: I have also looked at the permissions section of the nginx pitfalls:
However it doesn’t go into much detail about permissions, is just said don’t use 777.