Auto permissions for new files in folder for NGINX to read

411 views Asked by At

I have a mysql database that is generating new log files every few hours in /var/www/html folder using such command -

SELECT * FROM logs.today INTO OUTFILE '/var/www/html/todayslogs.csv';

And this is how the generated file looks (LOGS.csv) enter image description here

I have tried running -

chmod g+s /var/www/html

But nginx still can't read the files that are created by mysql, please help, thank you!

P.s I am running debian 4.19.181-1

1

There are 1 answers

0
tink On

Well ... making the group ownership "sticky" won't help you much if the group is root and www-data isn't a member of it.

I wouldn't recommend adding the nginx user to that group, though, so your safest bet would be to modify the group ownership of the generated logs to www-data.