I'm running two webservers in a single host. One of them is a Tomcat running in a reverse proxy configuration. The front webserver is a nginx that proxies request to the Tomcat.
So far, is working ok.
A location in a domain, let's say domain.com/photos is server by Tomcat. I'd like the photos to be server by nginx. The files are stored in a folder, but the files are written by Tomcat application and the files end up with owner tomcat and group tomcat.
The nginx process is running in www-data group, so it cannot retrieve the files.
How can I accomplish that the the webservers runs under the same group? Is a good practice to use newgrp before starting the webservers, so both runs under the same group?