Fix Flask Issues
Troubleshooting guides for common Flask, Nginx, and Gunicorn production errors.
This section is for production failures that appear after deployment. Most issues fall into one of a few categories: upstream connectivity, socket permissions, static file paths, or media serving configuration.
Start with the symptom you can observe most clearly. A 502 usually points to upstream failure, connection refused points to a missing listener, and broken CSS or uploads usually point to Nginx path or permission mistakes.
Fix Flask 502 Bad Gateway
Identify and resolve 502 errors between Nginx and Gunicorn.
Nginx Not Connecting (Refused)
Fix connection refused errors when Nginx cannot reach the Gunicorn listener.
Socket Permission Denied
Resolve file permission issues when using Unix sockets for Gunicorn.
Static Files Not Loading
Fix 404 errors for CSS, JS, and images in production.
Media Uploads Broken
Configure Nginx to correctly serve user-uploaded media files.
App Not Reloading
Troubleshoot why your Flask app isn't showing changes after deployment.
Fast Triage Rule
Check Nginx error logs first, then Gunicorn status, then the file or socket path involved. That order usually reveals whether the fault is configuration, permissions, or application startup.