fix(nginx): improve logging and robustness