From 5b9a1140858503ae75f3eda46a30d793c2fc1beb Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Fri, 23 Feb 2024 14:45:10 +1100 Subject: [PATCH] fix: nginx permissions --- sites.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sites.py b/sites.py index 547ab35..ab9003d 100644 --- a/sites.py +++ b/sites.py @@ -228,6 +228,10 @@ def write_nginx_conf(site): with open(f'/etc/nginx/sites-enabled/{id}.conf', 'w') as file: file.write(conf) + # Give read permissions to nginx for the /root/site-manager/uploads directory + os.system(f'chown -R www-data:www-data {location}') + os.system(f'chmod -R 755 {location}') + # Restart nginx os.system('systemctl restart nginx') return True \ No newline at end of file