Repository: kubernetes/ingress-nginx
Pull request #5691 (2020-06-10 14:13:27)

use-regex annotation should be applied to only one Location
<!--- Provide a general summary of your changes in the Title above --->
<!--- Please don't @-mention people in PR or commit messages (do so in an additional comment). --->

## What this PR does / why we need it:

Setting the `use-regex` annotation changes the location modifier to all the locations of the server

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Which issue/s this PR fixes
<!--
(optional, in `fixes #<issue number>` format, will close that issue when PR gets merged):

fixes #
-->

## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->

## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I've read the [CONTRIBUTION](https://github.com/kubernetes/ingress-nginx/blob/master/CONTRIBUTING.md) guide
- [ ] I have added tests to cover my changes.
- [x] All new and existing tests passed.


ElvinEfendi: I don't see any link to a reported issue/bug. Can you describe the problem with more details?
aledbf: > I don't see any link to a reported issue/bug. Can you describe the problem with more details?

Reported in slack https://kubernetes.slack.com/archives/CANQGM8BA/p1591793882321000
PCatinean: I can open an official issue on github if needed with the information compressed. Let me know if it's needed
k8s-ci-robot: @aledbf: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-ingress-nginx-e2e-1-16 | efec056d37f024c5675f915583b34fdf6083aa67 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-16/1270720810994110464) | `/test pull-ingress-nginx-e2e-1-16`
pull-ingress-nginx-e2e-1-18 | efec056d37f024c5675f915583b34fdf6083aa67 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-18/1270720811010887680) | `/test pull-ingress-nginx-e2e-1-18`
pull-ingress-nginx-e2e-1-17 | efec056d37f024c5675f915583b34fdf6083aa67 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-17/1270720810985721856) | `/test pull-ingress-nginx-e2e-1-17`
pull-ingress-nginx-e2e-1-15 | b080a7e16b269a7d1f4864e600c14153724645ca | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-15/1272707652132016128) | `/test pull-ingress-nginx-e2e-1-15`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes&repo=ingress-nginx&pr=5691). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3aledbf). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes/ingress-nginx/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @aledbf: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-ingress-nginx-e2e-1-16 | efec056d37f024c5675f915583b34fdf6083aa67 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-16/1270720810994110464) | `/test pull-ingress-nginx-e2e-1-16`
pull-ingress-nginx-e2e-1-17 | efec056d37f024c5675f915583b34fdf6083aa67 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-17/1270720810985721856) | `/test pull-ingress-nginx-e2e-1-17`
pull-ingress-nginx-e2e-1-15 | b080a7e16b269a7d1f4864e600c14153724645ca | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-15/1272707652132016128) | `/test pull-ingress-nginx-e2e-1-15`
pull-ingress-nginx-e2e-1-18 | b080a7e16b269a7d1f4864e600c14153724645ca | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-18/1272707652115238912) | `/test pull-ingress-nginx-e2e-1-18`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes&repo=ingress-nginx&pr=5691). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3aledbf). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes/ingress-nginx/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @aledbf: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-ingress-nginx-e2e-1-17 | efec056d37f024c5675f915583b34fdf6083aa67 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-17/1270720810985721856) | `/test pull-ingress-nginx-e2e-1-17`
pull-ingress-nginx-e2e-1-15 | b080a7e16b269a7d1f4864e600c14153724645ca | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-15/1272707652132016128) | `/test pull-ingress-nginx-e2e-1-15`
pull-ingress-nginx-e2e-1-18 | b080a7e16b269a7d1f4864e600c14153724645ca | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-18/1272707652115238912) | `/test pull-ingress-nginx-e2e-1-18`
pull-ingress-nginx-e2e-1-16 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-16/1272714321289285632) | `/test pull-ingress-nginx-e2e-1-16`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes&repo=ingress-nginx&pr=5691). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3aledbf). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes/ingress-nginx/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @aledbf: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-ingress-nginx-e2e-1-17 | efec056d37f024c5675f915583b34fdf6083aa67 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-17/1270720810985721856) | `/test pull-ingress-nginx-e2e-1-17`
pull-ingress-nginx-e2e-1-18 | b080a7e16b269a7d1f4864e600c14153724645ca | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-18/1272707652115238912) | `/test pull-ingress-nginx-e2e-1-18`
pull-ingress-nginx-e2e-1-16 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-16/1272714321289285632) | `/test pull-ingress-nginx-e2e-1-16`
pull-ingress-nginx-e2e-1-15 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-15/1272714321297674240) | `/test pull-ingress-nginx-e2e-1-15`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes&repo=ingress-nginx&pr=5691). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3aledbf). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes/ingress-nginx/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @aledbf: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-ingress-nginx-e2e-1-17 | efec056d37f024c5675f915583b34fdf6083aa67 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-17/1270720810985721856) | `/test pull-ingress-nginx-e2e-1-17`
pull-ingress-nginx-e2e-1-16 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-16/1272714321289285632) | `/test pull-ingress-nginx-e2e-1-16`
pull-ingress-nginx-e2e-1-15 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-15/1272714321297674240) | `/test pull-ingress-nginx-e2e-1-15`
pull-ingress-nginx-e2e-1-18 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-18/1272714321272508416) | `/test pull-ingress-nginx-e2e-1-18`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes&repo=ingress-nginx&pr=5691). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3aledbf). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes/ingress-nginx/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
aledbf: /retest
k8s-ci-robot: @aledbf: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-ingress-nginx-e2e-1-17 | efec056d37f024c5675f915583b34fdf6083aa67 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-17/1270720810985721856) | `/test pull-ingress-nginx-e2e-1-17`
pull-ingress-nginx-e2e-1-16 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-16/1272714321289285632) | `/test pull-ingress-nginx-e2e-1-16`
pull-ingress-nginx-e2e-1-15 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-15/1272714321297674240) | `/test pull-ingress-nginx-e2e-1-15`
pull-ingress-nginx-e2e-1-18 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-18/1272721241685364736) | `/test pull-ingress-nginx-e2e-1-18`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes&repo=ingress-nginx&pr=5691). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3aledbf). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes/ingress-nginx/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @aledbf: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-ingress-nginx-e2e-1-16 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-16/1272714321289285632) | `/test pull-ingress-nginx-e2e-1-16`
pull-ingress-nginx-e2e-1-15 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-15/1272714321297674240) | `/test pull-ingress-nginx-e2e-1-15`
pull-ingress-nginx-e2e-1-18 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-18/1272721241685364736) | `/test pull-ingress-nginx-e2e-1-18`
pull-ingress-nginx-e2e-1-17 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-17/1272714321280897024) | `/test pull-ingress-nginx-e2e-1-17`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes&repo=ingress-nginx&pr=5691). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3aledbf). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes/ingress-nginx/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @aledbf: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-ingress-nginx-e2e-1-16 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-16/1272714321289285632) | `/test pull-ingress-nginx-e2e-1-16`
pull-ingress-nginx-e2e-1-18 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-18/1272721241685364736) | `/test pull-ingress-nginx-e2e-1-18`
pull-ingress-nginx-e2e-1-17 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-17/1272714321280897024) | `/test pull-ingress-nginx-e2e-1-17`
pull-ingress-nginx-e2e-1-15 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-15/1272721241676976128) | `/test pull-ingress-nginx-e2e-1-15`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes&repo=ingress-nginx&pr=5691). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3aledbf). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes/ingress-nginx/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @aledbf: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-ingress-nginx-e2e-1-18 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-18/1272721241685364736) | `/test pull-ingress-nginx-e2e-1-18`
pull-ingress-nginx-e2e-1-17 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-17/1272714321280897024) | `/test pull-ingress-nginx-e2e-1-17`
pull-ingress-nginx-e2e-1-15 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-15/1272721241676976128) | `/test pull-ingress-nginx-e2e-1-15`
pull-ingress-nginx-e2e-1-16 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-16/1272721241689559040) | `/test pull-ingress-nginx-e2e-1-16`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes&repo=ingress-nginx&pr=5691). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3aledbf). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes/ingress-nginx/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
aledbf: /retest
k8s-ci-robot: @aledbf: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-ingress-nginx-e2e-1-17 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-17/1272714321280897024) | `/test pull-ingress-nginx-e2e-1-17`
pull-ingress-nginx-e2e-1-15 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-15/1272721241676976128) | `/test pull-ingress-nginx-e2e-1-15`
pull-ingress-nginx-e2e-1-16 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-16/1272721241689559040) | `/test pull-ingress-nginx-e2e-1-16`
pull-ingress-nginx-e2e-1-18 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-18/1272870991369867264) | `/test pull-ingress-nginx-e2e-1-18`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes&repo=ingress-nginx&pr=5691). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3aledbf). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes/ingress-nginx/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @aledbf: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-ingress-nginx-e2e-1-15 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-15/1272721241676976128) | `/test pull-ingress-nginx-e2e-1-15`
pull-ingress-nginx-e2e-1-16 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-16/1272721241689559040) | `/test pull-ingress-nginx-e2e-1-16`
pull-ingress-nginx-e2e-1-18 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-18/1272870991369867264) | `/test pull-ingress-nginx-e2e-1-18`
pull-ingress-nginx-e2e-1-17 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-17/1272870991374061568) | `/test pull-ingress-nginx-e2e-1-17`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes&repo=ingress-nginx&pr=5691). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3aledbf). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes/ingress-nginx/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @aledbf: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-ingress-nginx-e2e-1-15 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-15/1272721241676976128) | `/test pull-ingress-nginx-e2e-1-15`
pull-ingress-nginx-e2e-1-18 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-18/1272870991369867264) | `/test pull-ingress-nginx-e2e-1-18`
pull-ingress-nginx-e2e-1-17 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-17/1272870991374061568) | `/test pull-ingress-nginx-e2e-1-17`
pull-ingress-nginx-e2e-1-16 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-16/1272870991361478656) | `/test pull-ingress-nginx-e2e-1-16`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes&repo=ingress-nginx&pr=5691). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3aledbf). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes/ingress-nginx/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @aledbf: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-ingress-nginx-e2e-1-18 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-18/1272870991369867264) | `/test pull-ingress-nginx-e2e-1-18`
pull-ingress-nginx-e2e-1-17 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-17/1272870991374061568) | `/test pull-ingress-nginx-e2e-1-17`
pull-ingress-nginx-e2e-1-16 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-16/1272870991361478656) | `/test pull-ingress-nginx-e2e-1-16`
pull-ingress-nginx-e2e-1-15 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-15/1272870991382450176) | `/test pull-ingress-nginx-e2e-1-15`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes&repo=ingress-nginx&pr=5691). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3aledbf). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes/ingress-nginx/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @aledbf: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-ingress-nginx-e2e-1-16 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-16/1272870991361478656) | `/test pull-ingress-nginx-e2e-1-16`
pull-ingress-nginx-e2e-1-15 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-15/1272870991382450176) | `/test pull-ingress-nginx-e2e-1-15`
pull-ingress-nginx-e2e-1-18 | d60620a801eed76f4335341774df1c1fcb20c78f | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-18/1272900813575950336) | `/test pull-ingress-nginx-e2e-1-18`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes&repo=ingress-nginx&pr=5691). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3aledbf). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes/ingress-nginx/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @aledbf: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-ingress-nginx-e2e-1-15 | 0a26a90bac12631046ea81725ebedc09e2374ac8 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-15/1272870991382450176) | `/test pull-ingress-nginx-e2e-1-15`
pull-ingress-nginx-e2e-1-18 | d60620a801eed76f4335341774df1c1fcb20c78f | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-18/1272900813575950336) | `/test pull-ingress-nginx-e2e-1-18`
pull-ingress-nginx-e2e-1-16 | d60620a801eed76f4335341774df1c1fcb20c78f | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-16/1272900813584338944) | `/test pull-ingress-nginx-e2e-1-16`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes&repo=ingress-nginx&pr=5691). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3aledbf). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes/ingress-nginx/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @aledbf: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-ingress-nginx-e2e-1-18 | d60620a801eed76f4335341774df1c1fcb20c78f | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-18/1272900813575950336) | `/test pull-ingress-nginx-e2e-1-18`
pull-ingress-nginx-e2e-1-16 | d60620a801eed76f4335341774df1c1fcb20c78f | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-16/1272900813584338944) | `/test pull-ingress-nginx-e2e-1-16`
pull-ingress-nginx-e2e-1-15 | d60620a801eed76f4335341774df1c1fcb20c78f | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-15/1272900813567561728) | `/test pull-ingress-nginx-e2e-1-15`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes&repo=ingress-nginx&pr=5691). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3aledbf). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes/ingress-nginx/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
aledbf: @PCatinean can you help to test the changes with the image `quay.io/kubernetes-ingress-controller/nginx-ingress-controller:dev`? Thanks!
aledbf: /assign @ElvinEfendi 
k8s-ci-robot: @aledbf: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-ingress-nginx-e2e-1-15 | d60620a801eed76f4335341774df1c1fcb20c78f | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-15/1272900813567561728) | `/test pull-ingress-nginx-e2e-1-15`
pull-ingress-nginx-e2e-1-16 | 87028a76b5b74741d38a01b5ca8985da8e6f5acc | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-16/1272928370618798080) | `/test pull-ingress-nginx-e2e-1-16`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes&repo=ingress-nginx&pr=5691). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3aledbf). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes/ingress-nginx/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @aledbf: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-ingress-nginx-e2e-1-15 | d60620a801eed76f4335341774df1c1fcb20c78f | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-15/1272900813567561728) | `/test pull-ingress-nginx-e2e-1-15`
pull-ingress-nginx-e2e-1-16 | 87028a76b5b74741d38a01b5ca8985da8e6f5acc | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-16/1272928370618798080) | `/test pull-ingress-nginx-e2e-1-16`
pull-ingress-nginx-e2e-1-17 | 87028a76b5b74741d38a01b5ca8985da8e6f5acc | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-17/1272928370610409472) | `/test pull-ingress-nginx-e2e-1-17`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes&repo=ingress-nginx&pr=5691). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3aledbf). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes/ingress-nginx/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @aledbf: The following tests **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-ingress-nginx-e2e-1-16 | 87028a76b5b74741d38a01b5ca8985da8e6f5acc | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-16/1272928370618798080) | `/test pull-ingress-nginx-e2e-1-16`
pull-ingress-nginx-e2e-1-17 | 87028a76b5b74741d38a01b5ca8985da8e6f5acc | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-17/1272928370610409472) | `/test pull-ingress-nginx-e2e-1-17`
pull-ingress-nginx-e2e-1-15 | 87028a76b5b74741d38a01b5ca8985da8e6f5acc | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-e2e-1-15/1272928370602020864) | `/test pull-ingress-nginx-e2e-1-15`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes&repo=ingress-nginx&pr=5691). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3aledbf). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes/ingress-nginx/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
aledbf: /retest
PCatinean: @aledbf on it
PCatinean: @aledbf tested with two separate ingresses and indeed it converts just the one with the annotation so as far as my limited example goes: LGTM :+1: 
aledbf: /test pull-ingress-nginx-e2e-1-16
PCatinean: Do we have an estimation of when this might land in stable?
aledbf: > Do we have an estimation of when this might land in stable?

Only a review is missing to merge the PR. Not sure what do you mean by stable? If you mean included in a release, the next one is in four or five weeks.
ElvinEfendi: @aledbf I'm trying to remember why we have this applied to all locations in a server. We might have done this to reason easier about the path matching. When you have both prefix and regex based matching I think it causes some problems with the order (also because of this, the PR might end up breaking some configurations). @zrdaley maybe you have an example that requires having the regex matching to be applied to all locations even if it is enabled on one?
zrdaley: 👋 The nginx algorithm will match prefix based locations first before evaluating any regular expressions. So lets say you have:

```
location ~*/foo {
    . . .
}
location / {
    . . .
}
``` 

Then a request to `/foo` will match `location /` even though it is ordered after the regex location `location ~*/foo` _and_ a less exact match.

I hope that helps, the `How Nginx Chooses Which Location to Use to Handle Requests` section on this [Digital Ocean article](https://www.digitalocean.com/community/tutorials/understanding-nginx-server-and-location-block-selection-algorithms#matching-location-blocks) has much more detail on this topic. 
k8s-ci-robot: @aledbf: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-ingress-nginx-codegen | 87028a76b5b74741d38a01b5ca8985da8e6f5acc | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/ingress-nginx/5691/pull-ingress-nginx-codegen/1276828180417613825) | `/test pull-ingress-nginx-codegen`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes&repo=ingress-nginx&pr=5691). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3aledbf). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes/ingress-nginx/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
aledbf: /retest

Patch:
diff --git a/internal/ingress/controller/template/template.go b/internal/ingress/controller/template/template.go
index 3666defbf..a0746be8a 100644
--- a/internal/ingress/controller/template/template.go
+++ b/internal/ingress/controller/template/template.go
@@ -171,7 +171,6 @@ var (
 		"buildOpentracing":                   buildOpentracing,
 		"proxySetHeader":                     proxySetHeader,
 		"buildInfluxDB":                      buildInfluxDB,
-		"enforceRegexModifier":               enforceRegexModifier,
 		"buildCustomErrorDeps":               buildCustomErrorDeps,
 		"buildCustomErrorLocationsPerServer": buildCustomErrorLocationsPerServer,
 		"shouldLoadModSecurityModule":        shouldLoadModSecurityModule,
@@ -373,26 +372,9 @@ func needsRewrite(location *ingress.Location) bool {
 	return false
 }
 
-// enforceRegexModifier checks if the "rewrite-target" or "use-regex" annotation
-// is used on any location path within a server
-func enforceRegexModifier(input interface{}) bool {
-	locations, ok := input.([]*ingress.Location)
-	if !ok {
-		klog.Errorf("expected an '[]*ingress.Location' type but %T was returned", input)
-		return false
-	}
-
-	for _, location := range locations {
-		if needsRewrite(location) || location.Rewrite.UseRegex {
-			return true
-		}
-	}
-	return false
-}
-
 // buildLocation produces the location string, if the ingress has redirects
 // (specified through the nginx.ingress.kubernetes.io/rewrite-target annotation)
-func buildLocation(input interface{}, enforceRegex bool) string {
+func buildLocation(input interface{}) string {
 	location, ok := input.(*ingress.Location)
 	if !ok {
 		klog.Errorf("expected an '*ingress.Location' type but %T was returned", input)
@@ -400,7 +382,7 @@ func buildLocation(input interface{}, enforceRegex bool) string {
 	}
 
 	path := location.Path
-	if enforceRegex {
+	if location.Rewrite.UseRegex {
 		return fmt.Sprintf(`~* "^%s"`, path)
 	}
 
diff --git a/rootfs/etc/nginx/template/nginx.tmpl b/rootfs/etc/nginx/template/nginx.tmpl
index 017feff81..0b6240d1d 100755
--- a/rootfs/etc/nginx/template/nginx.tmpl
+++ b/rootfs/etc/nginx/template/nginx.tmpl
@@ -903,9 +903,8 @@ stream {
 
         {{ buildMirrorLocations $server.Locations }}
 
-        {{ $enforceRegex := enforceRegexModifier $server.Locations }}
         {{ range $location := $server.Locations }}
-        {{ $path := buildLocation $location $enforceRegex }}
+        {{ $path := buildLocation $location }}
         {{ $proxySetHeader := proxySetHeader $location }}
         {{ $authPath := buildAuthLocation $location $all.Cfg.GlobalExternalAuth.URL }}
         {{ $applyGlobalAuth := shouldApplyGlobalAuth $location $all.Cfg.GlobalExternalAuth.URL }}
@@ -1309,6 +1308,8 @@ stream {
 
             {{ if not (empty $location.ProxySSL.ProxySSLName) }}
             proxy_ssl_name                          {{ $location.ProxySSL.ProxySSLName }};
+            {{ end }}
+            {{ if not (empty $location.ProxySSL.ProxySSLServerName) }}
             proxy_ssl_server_name                   {{ $location.ProxySSL.ProxySSLServerName }};
             {{ end }}
 


Test patch:
diff --git a/internal/ingress/controller/template/template_test.go b/internal/ingress/controller/template/template_test.go
index 2f2dd670a..3243dbda3 100644
--- a/internal/ingress/controller/template/template_test.go
+++ b/internal/ingress/controller/template/template_test.go
@@ -64,7 +64,7 @@ var (
 		Sticky           bool
 		XForwardedPrefix string
 		SecureBackend    bool
-		enforceRegex     bool
+		UseRegex         bool
 	}{
 		"when secure backend enabled": {
 			"/",
@@ -275,7 +275,7 @@ func TestQuote(t *testing.T) {
 func TestBuildLocation(t *testing.T) {
 	invalidType := &ingress.Ingress{}
 	expected := "/"
-	actual := buildLocation(invalidType, true)
+	actual := buildLocation(invalidType)
 
 	if !reflect.DeepEqual(expected, actual) {
 		t.Errorf("Expected '%v' but returned '%v'", expected, actual)
@@ -284,10 +284,10 @@ func TestBuildLocation(t *testing.T) {
 	for k, tc := range tmplFuncTestcases {
 		loc := &ingress.Location{
 			Path:    tc.Path,
-			Rewrite: rewrite.Config{Target: tc.Target},
+			Rewrite: rewrite.Config{Target: tc.Target, UseRegex: tc.UseRegex},
 		}
 
-		newLoc := buildLocation(loc, tc.enforceRegex)
+		newLoc := buildLocation(loc)
 		if tc.Location != newLoc {
 			t.Errorf("%s: expected '%v' but returned %v", k, tc.Location, newLoc)
 		}
@@ -1195,32 +1195,6 @@ func TestBuildOpenTracing(t *testing.T) {
 
 }
 
-func TestEnforceRegexModifier(t *testing.T) {
-	invalidType := &ingress.Ingress{}
-	expected := false
-	actual := enforceRegexModifier(invalidType)
-
-	if expected != actual {
-		t.Errorf("Expected '%v' but returned '%v'", expected, actual)
-	}
-
-	locs := []*ingress.Location{
-		{
-			Rewrite: rewrite.Config{
-				Target:   "/alright",
-				UseRegex: true,
-			},
-			Path: "/ok",
-		},
-	}
-	expected = true
-	actual = enforceRegexModifier(locs)
-
-	if expected != actual {
-		t.Errorf("Expected '%v' but returned '%v'", expected, actual)
-	}
-}
-
 func TestShouldLoadModSecurityModule(t *testing.T) {
 	// ### Invalid argument type tests ###
 	// The first tests should return false.
diff --git a/test/e2e/annotations/proxyssl.go b/test/e2e/annotations/proxyssl.go
index 1ab772d2c..0e928664e 100644
--- a/test/e2e/annotations/proxyssl.go
+++ b/test/e2e/annotations/proxyssl.go
@@ -45,7 +45,7 @@ var _ = framework.DescribeAnnotation("proxy-ssl-*", func() {
 		ing := framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, framework.EchoService, 80, annotations)
 		f.EnsureIngress(ing)
 
-		assertProxySSL(f, host, "DEFAULT", "TLSv1 TLSv1.1 TLSv1.2", "off", 1, "on")
+		assertProxySSL(f, host, "", "DEFAULT", "TLSv1 TLSv1.1 TLSv1.2", "off", 1, "")
 
 		f.HTTPTestClient().
 			GET("/").
@@ -75,7 +75,7 @@ var _ = framework.DescribeAnnotation("proxy-ssl-*", func() {
 		ing := framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, framework.EchoService, 80, annotations)
 		f.EnsureIngress(ing)
 
-		assertProxySSL(f, host, "DEFAULT", "TLSv1 TLSv1.1 TLSv1.2", "on", 2, "on")
+		assertProxySSL(f, host, "", "DEFAULT", "TLSv1 TLSv1.1 TLSv1.2", "on", 2, "on")
 
 		f.HTTPTestClient().
 			GET("/").
@@ -103,7 +103,7 @@ var _ = framework.DescribeAnnotation("proxy-ssl-*", func() {
 		ing := framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, framework.EchoService, 80, annotations)
 		f.EnsureIngress(ing)
 
-		assertProxySSL(f, host, "HIGH:!AES", "TLSv1 TLSv1.1 TLSv1.2", "off", 1, "off")
+		assertProxySSL(f, host, "", "HIGH:!AES", "TLSv1 TLSv1.1 TLSv1.2", "off", 1, "")
 
 		f.HTTPTestClient().
 			GET("/").
@@ -131,7 +131,7 @@ var _ = framework.DescribeAnnotation("proxy-ssl-*", func() {
 		ing := framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, framework.EchoService, 80, annotations)
 		f.EnsureIngress(ing)
 
-		assertProxySSL(f, host, "DEFAULT", "TLSv1.2 TLSv1.3", "off", 1, "off")
+		assertProxySSL(f, host, "", "DEFAULT", "TLSv1.2 TLSv1.3", "off", 1, "")
 
 		f.HTTPTestClient().
 			GET("/").
@@ -169,7 +169,7 @@ var _ = framework.DescribeAnnotation("proxy-ssl-*", func() {
 		wlValue := "true"
 		f.UpdateNginxConfigMapData(wlKey, wlValue)
 
-		assertProxySSLName(f, host, secretName, "DEFAULT", "TLSv1 TLSv1.1 TLSv1.2", "on", 1, "on")
+		assertProxySSL(f, host, secretName, "DEFAULT", "TLSv1 TLSv1.1 TLSv1.2", "on", 1, "on")
 
 		f.WaitForNginxCustomConfiguration("## start server proxyssl.com", "location ", func(server string) bool {
 			return (!strings.Contains(server, "proxy_ssl_trusted_certificate") &&
@@ -198,32 +198,27 @@ var _ = framework.DescribeAnnotation("proxy-ssl-*", func() {
 
 })
 
-func assertProxySSL(f *framework.Framework, host, ciphers, protocols, verify string, depth int, proxySSLServerName string) {
+func assertProxySSL(f *framework.Framework, host, sslName, ciphers, protocols, verify string, depth int, proxySSLServerName string) {
 	certFile := fmt.Sprintf("/etc/ingress-controller/ssl/%s-%s.pem", f.Namespace, host)
-	f.WaitForNginxServer(host,
-		func(server string) bool {
-			return strings.Contains(server, fmt.Sprintf("proxy_ssl_certificate %s;", certFile)) &&
-				strings.Contains(server, fmt.Sprintf("proxy_ssl_certificate_key %s;", certFile)) &&
-				strings.Contains(server, fmt.Sprintf("proxy_ssl_trusted_certificate %s;", certFile)) &&
-				strings.Contains(server, fmt.Sprintf("proxy_ssl_ciphers %s;", ciphers)) &&
-				strings.Contains(server, fmt.Sprintf("proxy_ssl_protocols %s;", protocols)) &&
-				strings.Contains(server, fmt.Sprintf("proxy_ssl_verify %s;", verify)) &&
-				strings.Contains(server, fmt.Sprintf("proxy_ssl_verify_depth %d;", depth)) &&
-				strings.Contains(server, fmt.Sprintf("proxy_ssl_server_name %s;", proxySSLServerName))
-		})
-}
 
-func assertProxySSLName(f *framework.Framework, host, sslName, ciphers, protocols, verify string, depth int, proxySSLServerName string) {
-	certFile := fmt.Sprintf("/etc/ingress-controller/ssl/%s-%s.pem", f.Namespace, sslName)
+	if sslName != "" {
+		certFile = fmt.Sprintf("/etc/ingress-controller/ssl/%s-%s.pem", f.Namespace, sslName)
+	}
+
 	f.WaitForNginxServer(host,
 		func(server string) bool {
-			return strings.Contains(server, fmt.Sprintf("proxy_ssl_certificate %s;", certFile)) &&
+			c := strings.Contains(server, fmt.Sprintf("proxy_ssl_certificate %s;", certFile)) &&
 				strings.Contains(server, fmt.Sprintf("proxy_ssl_certificate_key %s;", certFile)) &&
 				strings.Contains(server, fmt.Sprintf("proxy_ssl_trusted_certificate %s;", certFile)) &&
 				strings.Contains(server, fmt.Sprintf("proxy_ssl_ciphers %s;", ciphers)) &&
 				strings.Contains(server, fmt.Sprintf("proxy_ssl_protocols %s;", protocols)) &&
 				strings.Contains(server, fmt.Sprintf("proxy_ssl_verify %s;", verify)) &&
-				strings.Contains(server, fmt.Sprintf("proxy_ssl_verify_depth %d;", depth)) &&
-				strings.Contains(server, fmt.Sprintf("proxy_ssl_server_name %s;", proxySSLServerName))
+				strings.Contains(server, fmt.Sprintf("proxy_ssl_verify_depth %d;", depth))
+
+			if proxySSLServerName == "" {
+				return c
+			}
+
+			return c && strings.Contains(server, fmt.Sprintf("proxy_ssl_server_name %s;", proxySSLServerName))
 		})
 }
diff --git a/test/e2e/annotations/rewrite.go b/test/e2e/annotations/rewrite.go
index 37c5a75b9..b357ce940 100644
--- a/test/e2e/annotations/rewrite.go
+++ b/test/e2e/annotations/rewrite.go
@@ -95,7 +95,8 @@ var _ = framework.DescribeAnnotation("rewrite-target use-regex enable-rewrite-lo
 
 		f.WaitForNginxServer(host,
 			func(server string) bool {
-				return strings.Contains(server, `location ~* "^/" {`) && strings.Contains(server, `location ~* "^/.well-known/acme/challenge" {`)
+				return strings.Contains(server, `location / {`) &&
+					strings.Contains(server, `location /.well-known/acme/challenge {`)
 			})
 
 		ginkgo.By("making a second request to the non-rewritten location")
@@ -129,7 +130,7 @@ var _ = framework.DescribeAnnotation("rewrite-target use-regex enable-rewrite-lo
 
 		f.WaitForNginxServer(host,
 			func(server string) bool {
-				return strings.Contains(server, `location ~* "^/foo" {`) && strings.Contains(server, `location ~* "^/foo.+" {`)
+				return strings.Contains(server, `location /foo {`) && strings.Contains(server, `location ~* "^/foo.+" {`)
 			})
 
 		ginkgo.By("ensuring '/foo' matches '~* ^/foo'")
@@ -170,7 +171,7 @@ var _ = framework.DescribeAnnotation("rewrite-target use-regex enable-rewrite-lo
 
 		f.WaitForNginxServer(host,
 			func(server string) bool {
-				return strings.Contains(server, `location ~* "^/foo/bar/bar" {`) &&
+				return strings.Contains(server, `location /foo/bar/bar {`) &&
 					strings.Contains(server, `location ~* "^/foo/bar/[a-z]{3}" {`)
 			})