nginx refactor