fix: nginx permissions

This commit is contained in:
Nathan Woodburn 2024-02-23 14:45:10 +11:00
parent e72909cb76
commit 5b9a114085
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -228,6 +228,10 @@ def write_nginx_conf(site):
with open(f'/etc/nginx/sites-enabled/{id}.conf', 'w') as file: with open(f'/etc/nginx/sites-enabled/{id}.conf', 'w') as file:
file.write(conf) 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 # Restart nginx
os.system('systemctl restart nginx') os.system('systemctl restart nginx')
return True return True