Commit graph

686 commits

Author SHA1 Message Date
spacewander
e118ebc08a Don't pick tried endpoint & count the latest in ewma balancer
fixes https://github.com/kubernetes/ingress-nginx/issues/6632
2020-12-18 19:21:51 +08:00
Josh Soref
a8728f3d2c Spelling 2020-12-15 16:10:48 -05:00
Manuel Alejandro de Brito Fontes
9c0a39636d Refactor ingress nginx variables 2020-12-12 08:52:47 -03:00
Elvin Efendi
cc94a51cba make sure canary attributes are reset on ewma backend sync 2020-12-11 09:38:58 -05:00
Kubernetes Prow Robot
baf2afc5de
Merge pull request #6546 from nic-6443/ewma-cananry-fix
bugfix: update trafficShapingPolicy not working in ewma load-balance
2020-12-11 03:29:23 -08:00
Elvin Efendi
1e9650a0f9 fix flaky lua tests 2020-12-10 22:41:41 -05:00
Matthew Tuusberg
1c6a1a0e23
feat: add support for country databases 2020-12-07 21:43:38 +03:00
Kubernetes Prow Robot
2f6f09a106
Merge pull request #6541 from Jangyooseok/Jangyooseok
fixed misspell
2020-12-04 15:35:25 -08:00
Jangyooseok
1ad89c8bb2 fixed misspell
Update rootfs/etc/nginx/lua/plugins/README.md
2020-12-04 10:13:00 +09:00
agile6v
06f53bcf05 feat: allow user to specify the maxmium number of retries in stream block. 2020-12-02 14:54:14 +08:00
qianyong
8ca5450e22 bugfix: always update trafficShapingPolicy when using ewma as load-balance even if endpoints not change, otherwise update trafficShapingPolicy will not working 2020-12-01 12:10:15 +08:00
m22r
612a604fa4 Fix ErrorLogLevel in stream contexts 2020-11-27 14:29:43 +09:00
Kubernetes Prow Robot
e3a3ea8826
Merge pull request #6294 from ianbuss/auth-error-redirect-param
Allow customisation of redirect URL parameter in external auth redirects
2020-11-23 01:27:37 -08:00
Julien Vey
fd8af11392
Fix opentracing propagation on auth-url
Currently, the opentracing propagation instructions are set only if opentracing is configured globally.
This fix set the propagation instructions if opentracing is disabled globally, but enabled per ingress
2020-11-20 01:32:20 +01:00
Manuel Alejandro de Brito Fontes
3f153add00 Refactor handling of path Prefix and Exact 2020-11-10 07:21:34 -03:00
Minji Chun
2e7967cc99 Add comment indicating server-snippet section 2020-11-04 18:59:39 +09:00
Manuel Alejandro de Brito Fontes
a6b6f03b53 Add support for k8s ingress pathtype Prefix 2020-11-02 09:56:49 -05:00
Manuel Alejandro de Brito Fontes
d74ea25df8 Add validation for wildcard server names 2020-10-26 10:51:14 -03:00
Kubernetes Prow Robot
524c3a50ea
Merge pull request #6037 from aledbf/redirect
Do not append a trailing slash on redirects
2020-10-08 11:51:06 -07:00
Ian Buss
41cf628bdf Add a configurable URL redirect parameter for error URLs 2020-10-08 12:53:46 +01:00
Kubernetes Prow Robot
8d45bb39a4
Merge pull request #5348 from Antiarchitect/stream-log-annotations
Ability to separately disable access log in http and stream contexts
2020-09-28 11:02:53 -07:00
Manuel Alejandro de Brito Fontes
493dd6726d
Replace request_uri 2020-09-27 20:26:39 -03:00
shrpne
2948e3e109 better cors 2020-09-27 21:44:24 +03:00
Maxime LUCE
b7b85175f6 Add annotation to configure CORS Access-Control-Expose-Headers 2020-09-23 17:41:52 +02:00
wenzong
87e79da16a Move ocsp_response_cache:delete after certificate_data:set 2020-09-19 23:16:00 +08:00
wenzong
16f970d8bb Use was_not_called without check args match 2020-09-19 00:15:42 +08:00
wenzong
724646bd73 Delete OCSP Response cache when certificate renewed 2020-09-18 14:30:18 +08:00
Elvin Efendi
8e83d4e84a delete redundant NGINX config about X-Forwarded-Proto 2020-09-15 13:22:26 -04:00
Manuel Alejandro de Brito Fontes
e659efbfdb Use dynamic load of modules 2020-09-10 11:39:35 -03:00
Kubernetes Prow Robot
33cab380ba
Merge pull request #5757 from agile6v/stream
feat: support to define trusted addresses for proxy protocol in stream block
2020-09-01 17:29:07 -07:00
agile6v
609e1b5775 feat: support to define trusted addresses for proxy protocol in stream block 2020-08-28 14:37:16 +08:00
Manuel Alejandro de Brito Fontes
bf11584dbd Add build_id dockerfile label 2020-08-27 10:05:07 -04:00
Manuel Alejandro de Brito Fontes
43ca5f5ef1 Add new Dockerfile label org.opencontainers.image.revision 2020-08-19 22:39:10 -04:00
Frank Gadban
e9059eef01 fixed some typos
Signed-off-by: Frank Gadban <frankgad@outlook.de>
2020-07-21 22:02:23 +02:00
Kubernetes Prow Robot
e825af86e1
Merge pull request #5887 from dschwar/force-use-forwarded-for
Add force-enable-realip-module
2020-07-17 07:17:02 -07:00
David Schwartz
d52141c2b9 Add enable-real-ip 2020-07-15 15:25:29 -04:00
Manuel Alejandro de Brito Fontes
dc3876666b Revert "use-regex annotation should be applied to only one Location"
This reverts commit a8a8b5f6e9.
2020-07-15 11:20:47 -04:00
Manuel Alejandro de Brito Fontes
a8a8b5f6e9 use-regex annotation should be applied to only one Location 2020-07-06 19:29:39 -04:00
Manuel Alejandro de Brito Fontes
ec4fb05cad Fix proxy ssl e2e test 2020-07-06 18:41:42 -04:00
Zhongcheng Lao
c0629e92c2
Add proxy-ssl-server-name to enable passing SNI 2020-07-03 14:14:32 +08:00
Kubernetes Prow Robot
baa2b2cd33
Merge pull request #5709 from agile6v/master
fix: remove duplicated X-Forwarded-Proto header.
2020-07-02 17:50:47 -07:00
agile6v
3402d07ff0
doc: update docs and fixed typos (#5821) 2020-07-01 10:02:52 -04:00
Manuel Alejandro de Brito Fontes
bcc3cfaa65 Dynamic LB sync non-external backends only when necessary 2020-06-29 18:11:51 -04:00
agile6v
e8aaa15ce8 Remove duplicated X-Forwarded-Proto header. 2020-06-25 11:11:00 +08:00
Kubernetes Prow Robot
803a76cf8a
Merge pull request #5749 from Bo0km4n/feat-configurable-max-batch-size
[Fix/metrics] Be configurable max batch size of metrics
2020-06-22 22:07:40 -07:00
mengqi.wmq
f232a264ab Add default-type as a configurable for default_type 2020-06-21 11:10:51 +08:00
Bo0km4n
7ab0916c92 Resolve conflicts 2020-06-20 17:13:31 +09:00
Bo0km4n
53a6b0fd3b Configurable metrics max batch size 2020-06-20 15:58:14 +09:00
agile6v
5b0f7d7d6e Improve performance. 2020-06-10 17:36:56 +08:00
Manuel Alejandro de Brito Fontes
1d4c7ec65c Fix lua lint error 2020-06-09 17:19:16 -04:00
Andreas Sommer
f27b404421 Serve correct TLS certificate for requests with uppercase host 2020-06-09 16:47:03 -04:00
Kubernetes Prow Robot
0549d9b132
Merge pull request #5672 from agile6v/master
feat: enable lj-releng tool to lint lua code.
2020-06-09 11:15:19 -07:00
agile6v
bafbd4cccf Enable lj-releng tool to lint lua code. 2020-06-09 18:01:35 +08:00
Jeff Hui
7767230e6a fix undefined variable $auth_cookie error when location is denied
(add) isLocationAllowed check before setting the cookie
2020-06-08 13:59:52 -04:00
agile6v
fc1c043437 Add http-access-log-path and stream-access-log-path options in configMap 2020-06-05 01:27:26 +08:00
Manuel Alejandro de Brito Fontes
ea8e711d2c Refactor build of docker images 2020-06-02 12:16:39 -04:00
Kubernetes Prow Robot
d061375afa
Merge pull request #5571 from agile6v/dev
feat: support the combination of Nginx variables for annotation upstream-hash-by.
2020-06-01 15:10:14 -07:00
agile6v
c035a144f8 Support the combination of nginx variables and text value for annotation upstream-hash-by. 2020-06-01 06:37:41 +08:00
Kubernetes Prow Robot
ee02d897d5
Merge pull request #5534 from agile6v/master
Add annotation ssl-prefer-server-ciphers.
2020-05-29 08:35:16 -07:00
adiov
d03266d505
Add MaxMind GeoIP2 Anonymous IP support 2020-05-21 06:50:57 +03:00
Andrey Voronkov
bced1ed8b8 Ability to separately disable access log in http and stream contexts
Two new configuration options:
`disable-http-access-log`
`disable-stream-access-log`

Should resolve issue with enormous amount of `TCP 200` useless entries in logs

Signed-off-by: Andrey Voronkov <voronkovaa@gmail.com>
2020-05-13 21:23:37 +03:00
agile6v
41d82005ec Add annotation ssl-prefer-server-ciphers. 2020-05-11 16:31:08 +08:00
Elvin Efendi
3b217cf766 make sure first backend sync happens in timer phase 2020-04-30 19:44:24 -04:00
Manuel Alejandro de Brito Fontes
c8eb914d8a Remove noisy dns log 2020-04-28 18:34:51 -04:00
Manuel Alejandro de Brito Fontes
0f2496fc95 Ensure alpine packages are up to date 2020-04-27 16:48:22 -04:00
Elvin Efendi
b569d2357a staple only when OCSP response status is "good" 2020-04-19 13:53:47 -04:00
Manuel Alejandro de Brito Fontes
d18fa90cfd Add e2e test for OCSP and new configmap setting 2020-04-17 12:53:47 -04:00
Elvin Efendi
1dab12fb81 Lua OCSP stapling 2020-04-16 21:29:16 -04:00
Elvin Efendi
b60e25f1db ingress-nginx lua plugins documentation 2020-04-14 09:47:58 -04:00
Manuel Alejandro de Brito Fontes
c0db19b0ec Enable configuration of plugins using configmap 2020-04-13 11:38:42 -04:00
Artem Miroshnychenko
eefb32c667 fix: remove unnecessary if statement when redirect annotation is defined 2020-04-08 19:02:15 +03:00
Manuel Alejandro de Brito Fontes
8527f774f7 Change condition order that produces endless loop 2020-04-03 10:53:40 -03:00
Manuel Alejandro de Brito Fontes
6037883c4a
Forward X-Request-ID to auth service (#5301) 2020-03-29 19:58:36 -03:00
Kubernetes Prow Robot
5cf7018b6d
Merge pull request #5277 from ElvinEfendi/small-refactoring
refactoring: use more specific var name
2020-03-23 06:02:51 -07:00
Manuel Alejandro de Brito Fontes
6ea6d47044 Empty directory 2020-03-22 17:16:30 -03:00
Manuel Alejandro de Brito Fontes
1894579455 Remove unnecessary logs 2020-03-22 17:09:39 -03:00
Elvin Efendi
eb112ea06c refactoring: use more specific var name 2020-03-21 21:23:24 -04:00
Manuel Alejandro de Brito Fontes
07b70f68bd
Redirect for app-root should preserve current scheme (#5266) 2020-03-19 15:49:18 -03:00
Maxim Pogozhiy
78576a9bbc Add Maxmind Editions support 2020-03-19 19:36:10 +07:00
Kubernetes Prow Robot
d5d1e9bfbd
Merge pull request #4958 from niedbalski/fix-forwarded-proto
Add a forwarded protocol map for included x-forwarded-proto.
2020-03-11 02:35:36 -07:00
Jorge Niedbalski
1d1b857cb7 Add a forwarded protocol map for included x-forwarded-proto.
This change adds a new map for including the passed x-forwarded-proto
header in case is provided as an extra header.

Signed-off-by: Jorge Niedbalski <jnr@metaklass.org>
2020-03-10 18:26:28 -03:00
Lisheng Zheng
f2e5d6f8a5 Migrate the backends handler logic to function 2020-02-27 09:31:04 +08:00
Laszlo Janosi
2de30bf451 Add proxy-ssl-name to location level 2020-02-25 13:52:34 +01:00
schaefec
141ea59b7f Allows overriding the server name used to verify the certificate of the proxied HTTPS server 2020-02-25 13:32:14 +01:00
Kubernetes Prow Robot
35264d6e8f
Merge pull request #5114 from whalecold/match
Feat: add header-pattern annotation.
2020-02-24 17:07:36 -08:00
Manuel Alejandro de Brito Fontes
351307280e Clean template 2020-02-21 16:14:49 -03:00
Lisheng Zheng
0b33650bb8 Feat: canary supports using specific match strategy to match header value. 2020-02-21 10:02:20 +08:00
Karl Stoney
5c64c52a60 Ensured that opentracing on auth request is only enabled for people that have opentracing 2020-02-20 14:12:54 +00:00
Karl Stoney
08471b527b Fixes https://github.com/kubernetes/ingress-nginx/issues/5120 2020-02-20 14:03:09 +00:00
Elvin Efendi
ad78425852 also expose pem cert uid in certificate.call function 2020-02-19 13:41:50 -05:00
Elvin Efendi
4bb9106be2 refactor ssl handling in preperation of OCSP stapling 2020-02-19 13:14:35 -05:00
briankopp
b2beeeab25 Add case for when user agent is nil
Add test for nil user agent
2020-02-16 21:07:45 -06:00
Manuel Alejandro de Brito Fontes
4b5c39e97b
Fox docker opencontainers version label (#5087) 2020-02-16 11:55:12 -03:00
Manuel Alejandro de Brito Fontes
12314aa1ac
Cleanup docker build (#5084) 2020-02-15 13:59:56 -03:00
Daniel Arifin
d48d5a61ae Add gzip-min-length as a configurable 2020-02-14 13:29:51 +07:00
Manuel Alejandro de Brito Fontes
71e35c9100
Make sure set-cookie is retained from external auth endpoint (#5067) 2020-02-14 01:41:11 -03:00
Kubernetes Prow Robot
5e54f66ab2
Merge pull request #5040 from BrianKopp/samesite-followup
Update documentation and remove hack fixed by upstream cookie library
2020-02-10 10:25:53 -08:00
Ilya Nemakov
46a3e0a6fd Fix X-Forwarded-Proto based on proxy-protocol server port 2020-02-10 18:08:34 +03:00
BrianKopp
7c7a1b9c8b Update samesite tests 2020-02-08 12:58:52 -07:00
BrianKopp
34b194c770 Update documentation and remove hack fixed by upstream cookie library 2020-02-08 11:54:52 -07:00
Manuel Alejandro de Brito Fontes
b3146354d4 Refactor mirror feature 2020-02-05 10:39:55 -03:00
Manuel Alejandro de Brito Fontes
b9e944a8a6
Move mod-security logic from template to go code (#5009) 2020-02-04 14:04:11 -03:00
Manuel Alejandro de Brito Fontes
ee5595f5be
Cleanup main makefile and remove the need of sed (#4995) 2020-01-31 22:56:55 -03:00
Brian Kopp
1b523390bb Add SameSite=None support and conditionally omit SameSite=None for backwards compatibility 2020-01-29 14:30:00 -07:00
Manuel Alejandro de Brito Fontes
5d05e19cc3
Fix enable opentracing per location (#4983) 2020-01-29 12:20:05 -03:00
Kubernetes Prow Robot
2f8cbeb8fa
Merge pull request #4956 from djboris9/proxy-protocol-port
Fix proxy protocol support for X-Forwarded-Port
2020-01-26 12:27:02 -08:00
Manuel Alejandro de Brito Fontes
7ff49b25d6
Move opentracing configuration for location to go (#4965) 2020-01-25 21:39:20 -03:00
Boris Djurdjevic
665f924e9e Add proxy protocol support for X-Forwarded-Port
Fixes https://github.com/kubernetes/ingress-nginx/issues/4951
2020-01-24 13:50:35 +01:00
Manuel Alejandro de Brito Fontes
c8015c7734
Update nginx image, use docker buildx and remove qemu (#4923)
* Update nginx image, use docker buildx and remove qemu

* Update e2e image
2020-01-14 20:52:57 -03:00
Manuel Alejandro de Brito Fontes
a8c2c9c6bc
Remove todo from lua test (#4894) 2020-01-08 19:46:52 -03:00
Manuel Alejandro de Brito Fontes
5ce93d98c2 Fix lua test 2020-01-05 16:00:54 -03:00
Manuel Alejandro de Brito Fontes
025d4eaceb Migrate to alpine linux 2020-01-04 13:23:16 -03:00
Manuel Alejandro de Brito Fontes
fbdd924a45 Update nginx image 2020-01-04 13:23:16 -03:00
Manuel Alejandro de Brito Fontes
6c92c80073 Fix sticky session for ingress without host 2020-01-02 16:52:49 -03:00
Manuel Alejandro de Brito Fontes
a0523c3c8a
Use a named location for authSignURL (#4859) 2019-12-24 22:50:25 -03:00
Elvin Efendi
54918c0ff2 fix duplicate hsts bug 2019-12-12 13:49:13 -05:00
MMeent
75e8d37d71
Fix issue in logic of modsec template
according to go templates: `(and ((not false) false))` == `true`

the only way to remove the owasp rules from every location is to disable modsec on that location, or to enable owasp globally, both not-so-great choices.

This commit fixes the logic issue by fixing the and-clause in the if-statement. As a result this reduces global resource usages when modsecurity is configured globally, but not on every location.
2019-11-28 14:56:41 +01:00
Kubernetes Prow Robot
a85d5ed93a
Merge pull request #4779 from aledbf/update-image
Remove lua-resty-waf feature
2019-11-27 11:45:05 -08:00
Kubernetes Prow Robot
b286c2a336
Merge pull request #4732 from willthames/enable-opentracing-annotation
Allow enabling/disabling opentracing for ingresses
2019-11-26 17:31:21 -08:00
Will Thames
0ae463a5f3 Provide annotation to control opentracing
By default you might want opentracing off, but on for a particular
ingress.

Similarly, you might want opentracing globally on, but disabled for
a specific endpoint. To achieve this, `opentracing_propagate_context`
cannot be set when combined with `opentracing off`

A new annotation, `enable-opentracing` allows more fine grained control
of opentracing for specific ingresses.
2019-11-27 11:07:26 +10:00
Manuel Alejandro de Brito Fontes
61d902db14 Remove Lua resty waf feature 2019-11-26 10:37:43 -03:00
Kubernetes Prow Robot
62518b60b4
Merge pull request #4689 from janosi/upstream_ssl
Server-only authentication of backends and per-location SSL config
2019-11-18 19:49:43 -08:00
Michael Frister
dea9c405e5 Docker image: Add more opencontainers labels (incl. version) 2019-11-18 10:20:20 +01:00
Michael Frister
be5349c05a Docker image: Add source code reference label
This allows tools that automate component updates (in our case Renovate Bot [1])
to automatically find the source repository for the Docker image and extract
release notes from there. Renovate Bot can include the relevant release notes
automatically in a merge request changing the component version.

In [2], Renovate added the label for their own Docker image.

[1] https://github.com/renovatebot/renovate
[2] https://github.com/renovatebot/renovate/pull/3753
2019-11-12 11:40:37 +01:00
Kubernetes Prow Robot
0d244e1c41
Merge pull request #4730 from stamm/master
add configuration for http2_max_concurrent_streams
2019-11-08 07:12:29 -08:00
Rustam Zagirov
d9cfad1894 add configuration for http2_max_concurrent_streams 2019-10-31 15:13:38 +03:00
Laszlo Janosi
cc84bd4ab6 Server level proxy_ssl parameters are applied again, following the comments received.
Also writing tls.crt and tls.key to disk is according to the original code.
2019-10-26 20:20:18 +02:00
Laszlo Janosi
31227d61c2 Removing secure-verify-ca-secret support and writing an error log if that annotation is used in an Ingress definition 2019-10-18 10:58:57 +02:00
Laszlo Janosi
37fe9c9876 Enabling per-location proxy-ssl parameters, so locations of the same server but with own unique Ingress definitions can have different SSL configs 2019-10-17 10:15:53 +02:00
Thomas Jackson
7fc442c7f1 update test cases 2019-10-14 08:14:35 -07:00
Thomas Jackson
b698699fdd More helpful DNS failure message
Previously if dns.lua failed to resolve a name you'd see the following in your logs:
```
2019/10/12 23:39:34 [error] 41#41: *6474 [lua] dns.lua:121: dns_lookup(): failed to query the DNS server:
server returned error code: 3: name error
server returned error code: 3: name error, context: ngx.timer
```

Unfortunately this doesn't tell you what name is failing (so you have to start guessing). To alleviate the pain this simply adds the host name we are attempting to resolve to the log line so users don't have to guess.
2019-10-14 08:14:35 -07:00
Kubernetes Prow Robot
69880ac9ad
Merge pull request #4650 from DaveAurionix/master
Expose GeoIP2 Organization as variable $geoip2_org
2019-10-12 15:34:36 -07:00
Sergei Turchanov
0476715022 Need to quote expansion of $cfg.LogFormatStream in log_stream access log
format in nginx.tmpl otherwise individual variables are just glued together
without separating spaces so that you would get these in access logs:

[10/Oct/2019:05:03:30 +0000]TCP200000.003
[10/Oct/2019:05:03:30 +0000]TCP200000.000
[10/Oct/2019:05:05:04 +0000]TCP200000.000

which supposed to be someting like these:
[10/Oct/2019:05:03:30 +0000] TCP 200 0 0 0.003
[10/Oct/2019:05:03:30 +0000] TCP 200 0 0 0.000
[10/Oct/2019:05:05:04 +0000] TCP 200 0 0 0.000
2019-10-10 17:27:15 +10:00
Dave Thompson
8e926b21d1 Expose GeoIP2 Organization as variable $geoip2_org 2019-10-09 09:47:48 +01:00
Kubernetes Prow Robot
8fd17045e6
Merge pull request #4603 from membphis/code-style
optimize: local cache global variable and reduce string object creation.
2019-10-08 07:51:15 -07:00
MRoci
72c4ffa8b5
add modsecurity-snippet key 2019-09-28 09:54:07 +02:00
Yuansheng
e4571fdeef optimize: local cache global variable and reduce string object creation.
and some code style.
2019-09-25 09:43:11 -04:00
Elvin Efendi
73e659f5fc improve certificate configuration detection per request 2019-09-24 21:17:22 -04:00
Elvin Efendi
c5a8357f1d handle hsts header injection in lua 2019-09-24 21:17:22 -04:00
Elvin Efendi
c93d384fb1 delete redundant config 2019-09-24 18:51:35 -04:00
Elvin Efendi
8c64b12a96 refactor force ssl redirect logic 2019-09-24 14:57:52 -04:00
Elvin Efendi
e392c8a8af cleanup unused certificates 2019-09-24 14:16:03 -04:00
Kubernetes Prow Robot
1dc4d184a0
Merge pull request #4550 from Shopify/upstream-auth-proxy-set-headers
Add support for configmap of headers for auth-url per ingress
2019-09-24 09:33:27 -07:00
Kubernetes Prow Robot
0f378154a0
Merge pull request #4591 from membphis/change/lua-code-style
optimize: local cache global variable and avoid single lines over 80
2019-09-24 07:55:29 -07:00
A Gardner
786a3b6862 Add support for configmap of headers to be sent to external auth service 2019-09-24 10:53:23 -04:00
Yuansheng
1ce68c8723 optimize: local cache global variable and avoid single lines over 80
characters.
2019-09-24 10:08:45 -04:00
Kubernetes Prow Robot
f6c2f5fb97
Merge pull request #4514 from alexmaret/4475-stickyness-mode
Added new affinity mode for maximum session stickyness.
2019-09-24 05:09:27 -07:00
Alexander Maret-Huskinson
c26ab315b8 Fixed LUA lint findings. 2019-09-24 10:56:11 +02:00
Alexander Maret-Huskinson
f1839ddb42 Fixed review findings. 2019-09-24 10:46:02 +02:00
Manuel Alejandro de Brito Fontes
4b4176c830
Fix log format after #4557 2019-09-18 12:52:09 -03:00