Moved proxy header forward outside of if statement.