[nginx] Fix issues with redirection loop