nginx is not custom build, hence using the normal bash command to restart nginx server

This commit is contained in:
arul 2025-11-16 09:13:41 +05:30
parent f03bc9be65
commit b7d38474ed

View File

@ -1,13 +1,15 @@
#!/bin/bash
# Test Nginx configuration
if sudo /usr/local/nginx/sbin/nginx -t; then
echo "✅ Nginx config test passed, reloading..."
if sudo /usr/local/nginx/sbin/nginx -s reload; then
echo "🚀 Nginx reloaded successfully!"
else
echo "❌ Nginx reload failed!"
fi
sudo nginx -t
if [ $? -eq 0 ]; then
echo "✅ Nginx config test passed, reloading..."
sudo systemctl reload nginx
if [ $? -eq 0 ]; then
echo "🚀 Nginx reloaded successfully!"
else
echo "❌ Nginx reload failed!"
fi
else
echo "❌ Nginx config test failed!"
echo "❌ Nginx config test failed!"
fi