I have NGINX server set up as proxy to a rails application.
In the main config file /etc/nginx/nginx.conf
I've set user to be ec2-user
, which is the default user for this instance.
Since NGINX server is installed via sudo (root account), I had to change ownership of the lib directory sudo chown -Rf ec2-user:ec2-user /var/lib/nginx
this way in order to be able to show the compiled VueJS parts of the application.
Unfortunately, I now need to run this chown
command every time NGINX gets updated by the system, and I am not familiar enough with SysAdmin to ether:
- Know why I needed to do that in the first place?
- How to automate it post install?
- How to bypass this requirement without running NGINX as root?
Can anyone provide answers or suggest a better approach to deployment than I have in place?