Nginx -t changing ownersip of cache path
|Reported by:||Owned by:|
|uname -a:||Linux 4.14.62-70.117.amzn2.x86_64 #1 SMP Fri Aug 10 20:14:53 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux|
nginx version: nginx/1.16.0
built by gcc 4.8.5 20150623 ( Red Hat 4.8.5-36) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
Scenario - Nginx process is running as non-root user by specifying user in nginx.service systemd file. In nginx.conf , we have commented out "user" directive as we have specified user in systemd file.
So, nginx master and worker process are running as non root user. But when we run nginx -t, it goes and changes the ownership of cache directory specifed in nginx.conf, resulting in request failures.
Ideally this should not happen as nginx process is running as non root user and why "nginx -t" is explicitly changing the ownership.