How to Merge a Git Detached HEAD Back to Master - Resolve npm Permission Denied on package.json-Nginx Rewrite Rule Loop: Diagnosis and Solution

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