If your nginx web-server runs by user nginx or www-data, files in wwwroot need to be with nginx or www-data user permissions.
If your bash script copy files into wwwroot by root (for example), you need set permissions for wwwroot like:
Code:
chown -r www-data:www-data /var/www/html/