#!/bin/bash # Start Nginx and output to /dev/null service nginx start &> /dev/null # Check if Nginx started successfully if [ $? -ne 0 ]; then echo "Nginx failed to start" echo "Nginx error log:" chown www-data:www-data /var/log/nginx/error.log chmod 644 /var/log/nginx/error.log cat /var/log/nginx/error.log exit 1 fi # If Nginx started successfully, then start the Flask application python app.py