How to Fix the Git index.lock File Exists Error - Fixing Nginx Upstream Connection Refused in Load Balancing-Git Detached HEAD: Practical Checklist and Fixes

Result check
- Keep one change per test run so you know which step helped.
- Undo temporary changes after the issue is confirmed.