hybinet wrote:
Umm, why are the files owned by www-data in the first place? That makes no sense. nginx does not require write access to any of your website files. It only needs to be able to read them. You can make all your website files owned by your own username, set the permissions to 755, and let nginx read them to its heart's content.
If you have any web application that requires write access, such as a PHP script, you just change a few things in the FastCGI/FPM init script so that PHP runs as the same user who owns the website files. With Apache, it was customary to run PHP as www-data, but with nginx, there's no need to do that anymore.
many thanks, this is what I have done and I think it is best scenario.
regards