Ingress NGINX Controller for Kubernetes
Find a file
Christopher Larivière 65b8eeddec
Support cors-allow-origin with multiple origins (#7614)
* Add Initial support for multiple cors origins in nginx

- bump cluster version for `make dev-env`
- add buildOriginRegex function in nginx.tmpl
- add e2e 4 e2e tests for cors.go
- refers to feature request #5496

* add tests + use search to identify '*' origin

* add tests + use search to identify '*' origin

Signed-off-by: Christopher Larivière <lariviere.c@gmail.com>

* fix "should enable cors test" looking at improper values

* Modify tests and add some logic for origin validation

- add origin validation in cors ingress annotations
- add extra tests to validate regex
- properly escape regex using "QuoteMeta"
- fix some copy/paste errors

* add TrimSpace and length validation before adding a new origin

* modify documentation for cors and remove dangling comment

* add support for optional port mapping on origin

* support single-level wildcard subdomains + tests

* Remove automatic `*` fonctionality from incorrect origins

- use []string instead of basic string to avoid reparsing in template.go
- fix typo in docs
- modify template to properly enable only if the whole block is enabled
- modify cors parsing
- test properly by validating that the value returned is the proper
  origin
- update unit tests and annotation tests

* Re-add `*` when no cors origins are supplied + fix tests

- fix e2e tests to allow for `*`
- re-add `*` to cors parsing if trimmed cors-allow-origin is empty
(supplied but empty) and if it wasn't supplied at all.

* remove unecessary logic for building cors origin + remove comments

- add some edge cases in e2e tests
- rework logic for building cors origin

there was no need for logic in template.go for buildCorsOriginRegex
if there is a `*` it ill be short-circuited by first if.

if it's a wildcard domain or any domain (without a wildcard), it MUST
match the main/cors.go regex format.

if there's a star in a wildcard domain, it must be replaced with
`[A-Za-z0-9]+`

* add missing check in e2e tests
2021-11-02 12:31:42 -07:00
.github fix ingress syntax. (#7867) 2021-11-01 17:12:58 -07:00
build Support cors-allow-origin with multiple origins (#7614) 2021-11-02 12:31:42 -07:00
charts/ingress-nginx priorityClassName should be in " " (#7512) 2021-10-24 15:28:21 -07:00
cmd feature: added AdmissionController metrics (#7711) 2021-11-02 10:54:34 -07:00
deploy update documentation and templates for aws nlb (#7662) 2021-10-25 10:47:02 -07:00
docs Support cors-allow-origin with multiple origins (#7614) 2021-11-02 12:31:42 -07:00
hack update documentation and templates for aws nlb (#7662) 2021-10-25 10:47:02 -07:00
images Add myself as a reviewer to images/kube-webhook-certgen (#7845) 2021-10-25 07:04:24 -07:00
internal Support cors-allow-origin with multiple origins (#7614) 2021-11-02 12:31:42 -07:00
rootfs Support cors-allow-origin with multiple origins (#7614) 2021-11-02 12:31:42 -07:00
test Support cors-allow-origin with multiple origins (#7614) 2021-11-02 12:31:42 -07:00
version Refactor version helper (#4437) 2019-08-13 13:46:16 -04:00
.codecov.yml Migrate to codecov.io (#2120) 2018-02-20 08:27:02 -08:00
.gitignore Update go version, modules and remove ioutil 2021-08-06 14:15:21 -03:00
.luacheckrc Enable lj-releng tool to lint lua code. 2020-06-09 18:01:35 +08:00
Changelog.md Release v1.0.4 (#7805) 2021-10-12 20:25:48 -07:00
cloudbuild.yaml Changing gcb builder (#7584) 2021-09-02 12:15:46 -07:00
code-of-conduct.md Update code-of-conduct.md (#1842) 2017-12-20 15:34:27 -03:00
CONTRIBUTING.md add some information about triaging pull requests (#7822) 2021-10-19 06:52:39 -07:00
go.mod Support cors-allow-origin with multiple origins (#7614) 2021-11-02 12:31:42 -07:00
go.sum Support cors-allow-origin with multiple origins (#7614) 2021-11-02 12:31:42 -07:00
ISSUE_TRIAGE.md add some information about triaging pull requests (#7822) 2021-10-19 06:52:39 -07:00
LICENSE Initial commit 2016-11-04 23:54:14 +01:00
Makefile Update base nginx image to the corrected version (#7705) 2021-09-26 16:24:23 -07:00
mkdocs.yml Remove "Development" from Welcome page (#7150) 2021-05-23 06:39:38 -07:00
OWNERS update OWNERS and aliases files (#7365) 2021-07-16 06:24:09 -07:00
OWNERS_ALIASES Add myself as a reviewer to images/kube-webhook-certgen (#7845) 2021-10-25 07:04:24 -07:00
README.md Release v1.0.4 (#7805) 2021-10-12 20:25:48 -07:00
RELEASE.md Refine release docs (#7729) 2021-10-11 08:10:40 -07:00
SECURITY.md Add SECURITY.md 2020-07-27 16:01:17 -06:00
SECURITY_CONTACTS Add security contacts (#7642) 2021-09-15 12:24:12 -07:00
stable.txt Release v1.0.4 (#7805) 2021-10-12 20:25:48 -07:00
TAG Prepare for v1.0.4 release (#7804) 2021-10-12 15:35:49 -07:00

NGINX Ingress Controller

Go Report Card GitHub license GitHub stars GitHub stars FOSSA Status

Overview

ingress-nginx is an Ingress controller for Kubernetes using NGINX as a reverse proxy and load balancer.

Learn more about Ingress on the main Kubernetes documentation site.

Get started

See the Getting Started document.

Troubleshooting

If you encounter issues, review the troubleshooting docs, file an issue, or talk to us on the #ingress-nginx channel on the Kubernetes Slack server.

Changelog

See the list of releases to find out about feature changes. For detailed changes for each release; please check the Changelog.md file. For detailed changes on the ingress-nginx helm chart, please check the following CHANGELOG.md file.

Support Versions table

Ingress-nginx version k8s supported version Alpine Version Nginx Version
v1.0.4 1.22, 1.21, 1.20, 1.19 3.14.2 1.19.9†
v1.0.3 1.22, 1.21, 1.20, 1.19 3.14.2 1.19.9†
v1.0.2 1.22, 1.21, 1.20, 1.19 3.14.2 1.19.9†
v1.0.1 1.22, 1.21, 1.20, 1.19 3.14.2 1.19.9†
v1.0.0 1.22, 1.21, 1.20, 1.19 3.13.5 1.20.1
v0.49.3 1.21, 1.20, 1.19 3.14.2 1.19.9
v0.49.2 1.21, 1.20, 1.19 3.14.2 1.19.9
v0.49.1 1.21, 1.20, 1.19 3.14.2 1.19.9
v0.49.0 1.21, 1.20, 1.19 3.13.5 1.20.1
v0.48.1 1.21, 1.20, 1.19 3.13.5 1.20.1
v0.47.0 1.21, 1.20, 1.19 3.13.5 1.20.1
v0.46.0 1.21, 1.20, 1.19 3.13.2 1.19.6

This build is patched against CVE-2021-23017.

See this article if you want upgrade to the stable Ingress API.

Get Involved

Thanks for taking the time to join our community and start contributing!

  • This project adheres to the Kubernetes Community Code of Conduct. By participating in this project, you agree to abide by its terms.

  • Contributing: Contributions of all kind are welcome!

    • Read CONTRIBUTING.md for information about setting up your environment, the workflow that we expect, and instructions on the developer certificate of origin that we require.

    • Join our Kubernetes Slack channel for developer discussion : #ingress-nginx-dev.

    • Submit github issues for any feature enhancements, bugs or documentation problems. Please make sure to read the Issue Reporting Checklist before opening an issue. Issues not conforming to the guidelines may be closed immediately.

  • Support: Join the the #ingress-nginx-users channel inside the Kubernetes Slack to ask questions or get support from the maintainers and other users.

    • The github issues in the repository are exclusively for bug reports and feature requests.
  • Discuss: Tweet using the #IngressNginx hashtag.

License

Apache License 2.0