Richard Hansen
035bd2b5ac
fix: Remove default_server
listen option from fallback server
...
This fixes a bug introduced in commit
9b4bb07b348dc5a428b94416517291adb30794c3.
2023-04-13 01:16:54 -04:00
dependabot[bot]
695ad54dcf
ci: bump pytest from 7.2.2 to 7.3.0 in /test/requirements
...
Bumps [pytest](https://github.com/pytest-dev/pytest ) from 7.2.2 to 7.3.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases )
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst )
- [Commits](https://github.com/pytest-dev/pytest/compare/7.2.2...7.3.0 )
---
updated-dependencies:
- dependency-name: pytest
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-04-10 05:00:55 +00:00
Richard Hansen
9b4bb07b34
fix: Don't create fallback http(s) server when http(s) disabled
...
Before, a fallback http server was created to handle requests for
unknown virtual hosts even when `HTTPS_METHOD=nohttp`. (In this case,
all http vhosts would be unknown.) Likewise, a catch-all fallback
https server was still created even if `HTTPS_METHOD=nohttps`.
Now the fallback servers are created only if needed. This brings the
behavior in line with the documentation and user expectation. It will
also make it easier to implement a planned feature: different servers
on different ports.
2023-02-04 18:59:38 -05:00
Richard Hansen
9297e94389
fix: Emit TLS error if there are no certs available
...
Before, if neither the vhost-specific cert nor `default.crt` existed,
nginx-proxy would not create the https vhost. This resulted in nginx
either refusing the connection or serving the wrong vhost depending on
whether there was another https vhost with a certificate.
Now nginx-proxy always creates an https server for a vhost, even if
the vhost-specific certificate and the default certificate are both
missing. When both certs are missing, nginx is given empty
certificate data to make it possible for it to start up without an
error. The empty certificate data causes the user to see a TLS error,
which is much easier to troubleshoot than a connection refused error
or serving the wrong vhost.
2023-02-02 22:02:06 -05:00
Richard Hansen
16066cab61
fix: Don't create cert error https server if https is not enabled
2023-02-02 17:17:00 -05:00
Niek
7ca1da8358
feat: Add support for HTTP load balancing between the proxy and upstream server groups ( #2173 )
...
Add initial tests
Newlines
Remove unused variable
Co-authored-by: Richard Hansen <rhansen@rhansen.org>
Change comment value
Co-authored-by: Richard Hansen <rhansen@rhansen.org>
add missing services line
Co-authored-by: Richard Hansen <rhansen@rhansen.org>
Use deploy.replicas
Remove details about choosing a load balancing method
Feedback note
Co-authored-by: Nicolas Duchon <nicolas.duchon@gmail.com>
2023-03-21 07:49:27 +01:00
Richard Hansen
49bb37dfdb
feat: Add support for HTTP keep-alive between the proxy and upstream
2023-03-14 04:20:17 -04:00
dependabot[bot]
2fc3e6c28c
ci: bump pytest from 7.2.1 to 7.2.2 in /test/requirements
...
Bumps [pytest](https://github.com/pytest-dev/pytest ) from 7.2.1 to 7.2.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases )
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst )
- [Commits](https://github.com/pytest-dev/pytest/compare/7.2.1...7.2.2 )
---
updated-dependencies:
- dependency-name: pytest
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-03-06 05:04:42 +00:00
Richard Hansen
b5a54ac219
tests: Reduce scope of docker_compose
fixture (and friends)
...
This makes it possible to bring up different compose files for
different tests in the same test module.
This change does not negatively affect performance because the fixture
is a no-op if the docker compose filename is unchanged between tests.
2023-02-17 02:34:08 -05:00
Richard Hansen
4d8f878ba7
tests: Fixture that simplifies Docker compose file changes
2023-02-17 02:34:08 -05:00
Richard Hansen
f5a3492926
tests: Factor out DNS monkey patching to its own fixture
2023-02-17 02:34:08 -05:00
Richard Hansen
09a2f40633
tests: Turn helper function into docker_compose_file
fixture
...
This makes it easier for tests to override the filename.
2023-02-17 02:34:08 -05:00
Richard Hansen
01745a836f
tests: Fix path to ca-root.crt
...
`os.getcwd()` is not guaranteed to always return the `test/`
directory.
2023-02-17 02:34:08 -05:00
Richard Hansen
2115974e93
feat: Add ability to completely override location blocks
...
Co-authored-by: Trent Harvey <trent@harvdog.net>
2023-01-31 04:53:12 -05:00
Nicolas Duchon
8ac8b021b8
Merge pull request #2155 from rhansen/docker-pull
...
chore: Pass `--pull` to `docker build` to get fresh images
2023-01-30 07:57:44 +01:00
Richard Hansen
912a065406
chore: Pass --pull
to docker build
to get fresh images
...
This is a no-op if the images are already up to date, and it prevents
puzzling problems when the images are old.
2023-01-28 18:17:40 -05:00
Richard Hansen
6162427c45
fix: Generate at most one server
directive per container
2023-01-28 18:01:19 -05:00
Vincent Herlemont
07cc80ac6b
feat: Support LOG_FORMAT env variable ( #2151 )
2023-01-27 12:28:40 -05:00
Richard Hansen
8346b68a28
fix: Ignore VIRTUAL_HOST
set to the empty string
...
Fixes #2144
2023-01-23 20:48:16 -05:00
Richard Hansen
f8ae0a4b00
feat: DEFAULT_ROOT=none
disables the default location /
block
2023-01-23 20:47:00 -05:00
Richard Hansen
8fbc8514ef
feat: Unconditionally produce debug comments
...
Rationale for eliminating the check to see if the `DEBUG` environment
variable holds a true value:
* The `DEBUG` environment variable might be set on a container (for
purposes specific to that container, not `nginx-proxy`) to a value
that cannot be parsed as a bool, which would break `nginx-proxy`.
* It simplifies the template.
* It eliminates a cold code path.
* It avoids heisenbugs.
* It makes debugging easier for users.
Also delete the debug info tests, as they are fragile and they provide
limited value.
Alternatively, we could avoid collision with the container's use of
the `DEBUG` environment variable by using a container label [1] such
as `com.google.nginx-proxy.nginx-proxy.debug`. I think doing so has
dubious value, especially if we want to attempt backwards
compatibility with the `DEBUG` environment variable.
Fixes #2139
[1] https://docs.docker.com/engine/reference/commandline/run/#-set-metadata-on-container--l---label---label-file
Co-authored-by: Nicolas Duchon <nicolas.duchon@gmail.com>
2023-01-18 17:27:04 -05:00
Richard Hansen
92e1a6567e
tests: Remove extraction of nginx.tmpl
(now unnecessary)
2023-01-17 18:02:30 -05:00
Richard Hansen
486addd144
tests: Bind-mount the entire nginx-proxy directory in the container
2023-01-17 18:02:30 -05:00
Richard Hansen
569953521a
tests: Exit non-zero if creation of nginx-proxy-tester image fails
2023-01-17 18:02:30 -05:00
Richard Hansen
55cfae9636
tests: Avoid unnecessary bashisms
2023-01-17 18:02:30 -05:00
Richard Hansen
d56b5b370d
tests: Whitespace fixes
2023-01-17 18:02:30 -05:00
Richard Hansen
26b0b05f73
tests: Fix test_debug/*
tests when IPv6 is enabled
2023-01-17 18:02:29 -05:00
dependabot[bot]
9c9545bf7f
chore(deps): bump pytest from 7.2.0 to 7.2.1 in /test/requirements
...
Bumps [pytest](https://github.com/pytest-dev/pytest ) from 7.2.0 to 7.2.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases )
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst )
- [Commits](https://github.com/pytest-dev/pytest/compare/7.2.0...7.2.1 )
---
updated-dependencies:
- dependency-name: pytest
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-01-16 04:12:49 +00:00
dependabot[bot]
831615fdd4
chore(deps): bump requests from 2.28.1 to 2.28.2 in /test/requirements
...
Bumps [requests](https://github.com/psf/requests ) from 2.28.1 to 2.28.2.
- [Release notes](https://github.com/psf/requests/releases )
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md )
- [Commits](https://github.com/psf/requests/compare/v2.28.1...v2.28.2 )
---
updated-dependencies:
- dependency-name: requests
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-01-13 04:04:20 +00:00
浊酒
af877cf784
feat: Add proxy header X-Forwarded-Host
...
Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2022-12-26 17:59:50 -05:00
Nicolas Duchon
6f4f9ec20c
Merge pull request #1927 from rhansen/untrusted-headers
...
feat: Option to not trust `X-Forwarded-*` headers from clients
2022-12-26 20:47:05 +01:00
Nicolas Duchon
7c0d38cd2e
Merge pull request #1985 from hiqdev/networks-order
...
Make sure networks order is the same
2022-12-26 16:59:41 +01:00
Richard Hansen
8aa00fcea2
feat: Option to not trust X-Forwarded-*
headers from clients
...
If header values from a malicious client are passed to the backend
server unchecked and unchanged, the client may be able to subvert
security checks done by the backend server.
2022-12-19 02:48:01 -05:00
dependabot[bot]
e5b340cb6f
chore(deps): bump docker from 5.0.3 to 6.0.1 in /test/requirements
...
Bumps [docker](https://github.com/docker/docker-py ) from 5.0.3 to 6.0.1.
- [Release notes](https://github.com/docker/docker-py/releases )
- [Commits](https://github.com/docker/docker-py/compare/5.0.3...6.0.1 )
---
updated-dependencies:
- dependency-name: docker
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-12-01 14:30:16 +00:00
dependabot[bot]
b53e09373a
chore(deps): bump backoff from 1.11.1 to 2.2.1 in /test/requirements
...
Bumps [backoff](https://github.com/litl/backoff ) from 1.11.1 to 2.2.1.
- [Release notes](https://github.com/litl/backoff/releases )
- [Changelog](https://github.com/litl/backoff/blob/master/CHANGELOG.md )
- [Commits](https://github.com/litl/backoff/compare/v1.11.1...v2.2.1 )
---
updated-dependencies:
- dependency-name: backoff
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-12-01 13:02:13 +00:00
dependabot[bot]
302ecfff51
chore(deps): bump requests from 2.27.1 to 2.28.1 in /test/requirements
...
Bumps [requests](https://github.com/psf/requests ) from 2.27.1 to 2.28.1.
- [Release notes](https://github.com/psf/requests/releases )
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md )
- [Commits](https://github.com/psf/requests/compare/v2.27.1...v2.28.1 )
---
updated-dependencies:
- dependency-name: requests
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-12-01 12:00:48 +00:00
dependabot[bot]
d23a746833
chore(deps): bump pytest from 7.1.2 to 7.2.0 in /test/requirements
...
Bumps [pytest](https://github.com/pytest-dev/pytest ) from 7.1.2 to 7.2.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases )
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst )
- [Commits](https://github.com/pytest-dev/pytest/compare/7.1.2...7.2.0 )
---
updated-dependencies:
- dependency-name: pytest
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-10-26 04:21:21 +00:00
SilverFire - Dmitry Naumenko
510d376f00
Make sure networks order is the same
2022-05-11 12:56:18 +00:00
dependabot[bot]
20e76ac7a6
chore(deps): bump pytest from 7.1.1 to 7.1.2 in /test/requirements
...
Bumps [pytest](https://github.com/pytest-dev/pytest ) from 7.1.1 to 7.1.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases )
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst )
- [Commits](https://github.com/pytest-dev/pytest/compare/7.1.1...7.1.2 )
---
updated-dependencies:
- dependency-name: pytest
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-04-25 04:22:00 +00:00
dependabot[bot]
1cc3bbf5ce
chore(deps): bump pytest from 7.0.1 to 7.1.1 in /test/requirements
...
Bumps [pytest](https://github.com/pytest-dev/pytest ) from 7.0.1 to 7.1.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases )
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst )
- [Commits](https://github.com/pytest-dev/pytest/compare/7.0.1...7.1.1 )
---
updated-dependencies:
- dependency-name: pytest
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-03-18 04:16:58 +00:00
Gilles Filippini
5aba125fb7
chore: do not copy useless files into the image
...
Move required files but 'nginx.tmpl' into a local 'app' folder and copy the
folder content into the image.
'nginx.tmpl' should be moved as well, but this is a breaking change for
configuration with a separate 'docker-gen' container.
2022-03-07 16:01:15 +01:00
Nicolas Duchon
0185a2971c
tests: fix virtual path tests for new dhparam
2022-02-24 15:21:14 +01:00
Alexander Lieret
7ede0fa4b9
test: fix: Rename new test files
2022-02-24 15:08:18 +01:00
Alexander Lieret
2509fc1076
test: Add test cases for NETWORK_ACCESS=internal
2022-02-24 15:08:18 +01:00
Alexander Lieret
6a580ad664
test: Add test case for location config priority
2022-02-24 15:08:18 +01:00
Alexander Lieret
4099fcd618
test: Add test case for default app redirect
...
Co-authored-by: Jonathan Underwood <junderwood@bitcoinbank.co.jp>
2022-02-24 15:08:18 +01:00
Alexander Lieret
e08b3487c9
test: Add test to cover SSL of path-based routing
2022-02-24 15:08:18 +01:00
Alexander Lieret
33eab70d32
feat: Add custom location block to virtual paths
...
This features allows the custom location blocks to be added to the
virtual path based routing. The custom config can be specified for each
container individually.
2022-02-24 15:08:17 +01:00
Alexander Lieret
4b85e95824
feat: Replace path stripping with variable
...
This commit removes the automatic path stripping and replaces it with a
user configurable environment variable. This can be set individually for
each container.
2022-02-24 15:08:17 +01:00
Alexander Lieret
9df330e51e
feat: Add user customizable default root response
2022-02-24 15:08:15 +01:00