0

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:

  1. Know why I needed to do that in the first place?
  2. How to automate it post install?
  3. 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?

Vlad
  • 113
  • 5
  • 1
    Nginx should not be getting updated without a sysadmin being involved and aware of it. You'll just have to include the ownership change in your update process. It is a bit of a pain, but unavoidable. – miken32 Nov 29 '22 at 16:49

0 Answers0