On the server python + nginx.
Python is launched from user, nginx from www-data.
The site has the ability to upload a photo, the code is cut into the image, and saved in the desired folder. at the same time, the original is retained with the rights of 770, and the new cutting with the rights of 660. But through the site, none of them can be viewed. If I only manually change the rights to 755, then through the site these pictures become available. I tried in / etc / group to add the user www-data to the group to user, hoping that thereby both nginx and python would have a common group and they would have access to the files, but I was mistaken.
What am I doing wrong, from whom do I need to run something, or do I make some settings on the server, or something else? There is an option in the code to manually assign the rights to the saved files, but IMHO it is crooked, I think there should be an exit on the server level.
Thanks for attention.