1
0
mirror of https://github.com/thib8956/nginx-proxy synced 2025-07-03 15:25:45 +00:00

1141 Commits

Author SHA1 Message Date
1da623019f Merge pull request #2576 from nginx-proxy/dependabot/docker/nginxproxy/docker-gen-0.14.5-debian
build: bump nginxproxy/docker-gen from 0.14.4 to 0.14.5
2025-01-19 23:03:10 +01:00
e234ffba20 build: bump nginxproxy/docker-gen from 0.14.4-debian to 0.14.5-debian
Bumps nginxproxy/docker-gen from 0.14.4-debian to 0.14.5-debian.

---
updated-dependencies:
- dependency-name: nginxproxy/docker-gen
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-19 20:34:13 +00:00
18030a7896 Merge pull request #1737 from junderw/fix-redirect
feat: redirect non-GET methods using 308 instead of 301
2025-01-18 22:03:27 +01:00
dfbff1eb9c Merge pull request #2561 from nginx-proxy/fix/proto-with-multiports
fix: add proto to VIRTUAL_HOST_MULTIPORTS
2025-01-18 22:01:09 +01:00
34a33a2255 tests: virtual proto 2025-01-18 21:50:41 +01:00
a61e485410 tests: refactor due to rebase 2025-01-18 20:41:17 +01:00
9312d5239a docs: typo 2025-01-18 20:25:01 +01:00
9fc7cec15c feat: customizable non get redirect code 2025-01-18 20:25:01 +01:00
8447a36046 tests: parameterize test 2025-01-18 20:25:01 +01:00
923f05032f tests: fix tests & test compose file 2025-01-18 20:25:01 +01:00
820d4a29ac tests: redirects 2025-01-18 20:25:01 +01:00
1859811311 feat: redirect using 308 for non-GET requests 2025-01-18 20:25:01 +01:00
691724c81f Merge pull request #2570 from nginx-proxy/test/refactor-darwin
tests: factor out base nginx-proxy config and enable local testing on macOS / Darwin
2025-01-05 11:37:45 +01:00
aa8145b62d tests: review changes
Co-authored-by: Niek <100143256+SchoNie@users.noreply.github.com>
2025-01-05 00:05:30 +01:00
836012cad6 docs: update test README 2025-01-03 16:00:36 +01:00
005377c6e5 tests: remove remaining unneeded container config 2024-12-30 20:45:08 +01:00
bfdd72fe95 tests: type hints and linting 2024-12-30 14:17:03 +01:00
40309e2441 tests: enable local testing on macOS / Darwin 2024-12-30 13:41:47 +01:00
daa9449176 tests: factor out base nginx-proxy config 2024-12-30 12:07:30 +01:00
4ccbc3edec Merge pull request #2569 from nginx-proxy/test/cleanup
tests: fix, cleanup and restructure test code
2024-12-27 21:47:56 +01:00
1f732a54c6 tests: missing doubles quotes on WEB_PORTS 2024-12-27 21:36:39 +01:00
ae0c9a8e96 tests: fixture type hints and style standardization 2024-12-27 21:36:07 +01:00
ea99c1a6f9 tests: review comments 2024-12-27 16:16:55 +01:00
1e9745f604 tests: complete typing, minor fixes 2024-12-26 16:21:30 +01:00
7b6baa43cd tests: remove custom system_has_ipv6() method 2024-12-26 01:13:29 +01:00
a2c316a876 docs: add powered by section with relevant JetBains IDEs
JetBrains is providing a license for GoLang and PyCharm to the
maintainer of this project as part of their open source program.
2024-12-25 15:39:00 +01:00
fb0fc331c0 tests: minor typos and code style 2024-12-24 16:26:23 +01:00
eb09876f97 tests: standardize file structure & naming 2024-12-24 16:22:20 +01:00
35e2d21527 tests: do not remove containers on host 2024-12-24 14:05:42 +01:00
b5dea1cf50 tests: cleanup test code
- remove unused imports in test cases
- fix code smells and code style in conftest.py
2024-12-24 13:53:09 +01:00
c60eff5d16 Merge pull request #2566 from SchoNie/python3.12+
ci: python 3.12+ compatibility
2024-12-18 17:29:28 +01:00
142a159d56 ci: bump python module docker version check
ci: bump python module docker version check
2024-12-18 11:35:01 +01:00
92eb45f0ec ci: python 3.12+ compatibility
ci: python 3.12+ compatibility
2024-12-18 11:34:19 +01:00
2bb0bbe5c9 Merge pull request #2565 from nginx-proxy/chore/compose-version-obsolete
chore: docker compose version is obsolete
2024-12-18 02:39:23 +01:00
fbad3ac3fc chore: docker compose version is obsolete 2024-12-18 02:08:46 +01:00
0c4be4e90f docs: better custom config examples
plus a few minor fixes and some linting
2024-12-09 00:17:48 +01:00
b9657874b9 Merge pull request #2563 from nginx-proxy/tests/cert-select
tests: supplemental test for certificate selection
2024-12-08 21:55:27 +01:00
56a4bb8601 tests: supplemental test for certificate selection 2024-12-08 21:30:47 +01:00
c67739f1cc ci: remove dockerhub login for tests
This break tests on forked repositories.
2024-12-08 18:23:57 +01:00
a25b7ea1ef docs: add proto to VIRTUAL_HOST_MULTIPORTS 2024-12-08 14:06:38 +01:00
22e6e59034 Merge pull request #2558 from nginx-proxy/fix/wildcard-cert-select
fix: wildcard certificates should only work one level deep
2024-12-08 13:25:57 +01:00
0c141e64ba ci: only push on demand images to nginxproxy/nginx-proxy 2024-12-08 13:15:38 +01:00
3c5bbcf029 docs: clarify certificate selection 2024-12-08 13:11:50 +01:00
9bd84fc95e fix: add proto to VIRTUAL_HOST_MULTIPORTS 2024-12-08 11:59:48 +01:00
b6c8851794 Merge pull request #2499 from nginx-proxy/ipv6
feat: basic implementation of IPv6 for IPv6 docker networks
2024-12-08 11:58:12 +01:00
30299e69bc tests: certificate selection 2024-12-07 20:15:44 +01:00
271e31dec4 fix: wildcard certificates should only work one level deep 2024-12-07 19:33:53 +01:00
559ddc7d13 Merge pull request #2535 from nginx-proxy/restore-default-certificate
feat: trust default certificate
2024-12-07 18:04:16 +01:00
e96a3ddec2 ci: build/publish on demand workflow 2024-12-03 08:31:08 +01:00
f0034c661a Merge pull request #2554 from nginx-proxy/dependabot/pip/test/requirements/pytest-8.3.4
ci: bump pytest from 8.3.3 to 8.3.4 in /test/requirements
2024-12-02 09:22:36 +01:00
7c003a4aa4 docs: markdown linting 2024-12-02 09:21:03 +01:00
ac4ce5b775 ci: bump pytest from 8.3.3 to 8.3.4 in /test/requirements
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.3 to 8.3.4.
- [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/8.3.3...8.3.4)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-02 04:39:24 +00:00
baa2ce5e8b docs: IPv6 support for docker networks 2024-12-01 22:41:09 +01:00
993bcc07c0 test: globally untrusted default cert 2024-12-01 20:24:53 +01:00
07b469d8ac docs: default certificate optional trust 2024-12-01 19:58:30 +01:00
ce2e076d65 chore: add wip folder to .gitignore 2024-12-01 19:35:06 +01:00
d4b1925624 Merge pull request #2548 from nginx-proxy/dependabot/docker/library/nginx-1.27.3
build: bump library/nginx from 1.27.2 to 1.27.3
2024-11-30 15:11:07 +01:00
d433b3bee6 Merge pull request #2550 from nginx-proxy/refactor-template
refactor: nginx template
2024-11-30 14:48:17 +01:00
7fee758a70 Merge pull request #2551 from SchoNie/docker-upstream-changes
chore: changes from upstream docker install
2024-11-30 14:36:42 +01:00
d30b573b2c chore: changes from upstream docker install 2024-11-28 14:11:50 +01:00
f600ce3e11 Merge pull request #2549 from SchoNie/readme-tweaks
docs: alerts markdown
2024-11-27 20:30:36 +01:00
b4c2b0dd5e Extra newline for readability 2024-11-27 20:17:00 +01:00
12b482a7ea Change regular expression tip to note 2024-11-27 20:15:08 +01:00
c6664335b7 Alerts Markdown
Use [Alerts Markdown extension](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts) available since [December 2023](https://github.blog/changelog/2023-12-14-new-markdown-extension-alerts-provide-distinctive-styling-for-significant-content/) to better indicate the significance of the content for some documentation.
2024-11-27 09:19:25 +01:00
f54f89a5f3 Merge pull request #2547 from SchoNie/loadbalance-readme
docs: remove experimental label for http loadbalance
2024-11-27 08:37:53 +01:00
760c891a0c build: bump library/nginx from 1.27.2 to 1.27.3
Bumps library/nginx from 1.27.2 to 1.27.3.

---
updated-dependencies:
- dependency-name: library/nginx
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-27 04:11:14 +00:00
627b6ad75f Remove experimental label
Remove experimental label.
2024-11-26 10:34:28 +01:00
b0efe80f05 fix: debug endpoint formatting 2024-11-26 01:06:51 +01:00
90e9308f87 refactor: better virtual hosts merging 2024-11-26 01:06:01 +01:00
f325dadd6a refactor: enhance readability 2024-11-26 01:05:08 +01:00
4d03645200 refactor: deduplicate upstream_name definition 2024-11-26 01:01:55 +01:00
57016e43f3 Merge pull request #2546 from nginx-proxy/keepalive-auto-by-default
feat: enable keepalive by default
2024-11-25 18:01:21 +01:00
c944877b70 Merge pull request #2545 from nginx-proxy/dependabot/docker/nginxproxy/docker-gen-0.14.4-debian
build: bump nginxproxy/docker-gen from 0.14.3-debian to 0.14.4
2024-11-25 18:00:19 +01:00
52ffab1ce6 feat: enable keepalive by default 2024-11-25 09:16:57 +01:00
7bd26d624d build: bump nginxproxy/docker-gen from 0.14.3-debian to 0.14.4-debian
Bumps nginxproxy/docker-gen from 0.14.3-debian to 0.14.4-debian.

---
updated-dependencies:
- dependency-name: nginxproxy/docker-gen
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-25 04:11:50 +00:00
d7acd931a3 Merge pull request #2538 from SchoNie/test-access-log-disabled
test: add test for DISABLE_ACCESS_LOGS
2024-11-05 20:19:07 +01:00
d4d6567bd3 Test for DISABLE_ACCESS_LOGS 2024-11-05 14:05:53 +01:00
9ca7d26821 Merge pull request #2537 from nginx-proxy/debug-endpoint-regexp
fix: do not render regexp hostname in debug endpoint response
2024-11-04 23:21:44 +01:00
fdb7310cda fix: do not render regexp hostname in debug endpoint response 2024-11-04 23:03:01 +01:00
40c153e8b0 test: default cert optional trust 2024-11-04 10:19:09 +01:00
a79445feef Merge pull request #2534 from nginx-proxy/refactor-globals
refactor: move $globals.ENV to $globals.config
2024-11-04 09:17:56 +01:00
80474e37e8 Merge pull request #2536 from nginx-proxy/dependabot/docker/nginxproxy/docker-gen-0.14.3-debian
build: bump nginxproxy/docker-gen from 0.14.2-debian to 0.14.3-debian
2024-11-04 08:15:19 +01:00
523112d205 build: bump nginxproxy/docker-gen from 0.14.2-debian to 0.14.3-debian
Bumps nginxproxy/docker-gen from 0.14.2-debian to 0.14.3-debian.

---
updated-dependencies:
- dependency-name: nginxproxy/docker-gen
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-04 04:17:03 +00:00
469765bbb7 feat: default certificate optional trust 2024-11-03 23:56:39 +01:00
023a3d17da fix: force enable HTTP when both vhost and default cert are missing 2024-11-03 21:06:23 +01:00
57e503c830 feat: trust default certificate 2024-11-03 20:10:32 +01:00
fbf3e2f458 docs: complete debug endpoint docs 2024-11-03 11:44:50 +01:00
7d909782f9 refactor: move debug's hostname into vhost 2024-11-03 11:28:39 +01:00
72bb8a66d8 refactor: further align template syntax 2024-11-02 23:45:31 +01:00
01d14f0942 refactor: align global config template syntax 2024-11-02 23:11:39 +01:00
cab2a2d151 refactor: move log configs to $globals.config 2024-11-02 22:05:58 +01:00
a06cd1ae9a refactor: move resolvers to $globals.config 2024-11-02 21:58:37 +01:00
946485e0b8 refactor: move default host to $globals.config 2024-11-02 21:52:27 +01:00
db0421eb4a refactor: move https method to $globals.config 2024-11-02 21:46:56 +01:00
30b909de8e refactor: move https enforcing to $globals.config 2024-11-02 21:32:41 +01:00
dcbb695a4b refactor: move global http2/http3 to $globals.config 2024-11-02 21:19:14 +01:00
07aef2bd83 refactor: move global acme challenge location to $globals.config 2024-11-02 21:13:56 +01:00
52100c40af refactor: move global hsts to $globals.config 2024-11-02 21:02:16 +01:00
031a2b16bb Merge pull request #2525 from nginx-proxy/debug-endpoint
feat: nginx-proxy debug endpoint
2024-11-02 17:32:47 +01:00
9114b8047d test: paths are stripped from debug endpoint response if too long 2024-11-02 17:20:25 +01:00
190030745c test: nginx-proxy debug endpoint 2024-11-02 16:48:55 +01:00
32ad9b7102 feat: protection against too long debug response 2024-11-02 16:04:21 +01:00
7dafac8b87 docs: documentation for debug endpoint 2024-11-02 16:04:21 +01:00
dce7663b69 refactor: remove duplicate code 2024-11-02 16:04:21 +01:00
fe52878940 refactor: expose clearly access log status in debug endpoint 2024-11-02 16:04:21 +01:00
ebed622fd7 feat: nginx-proxy debug endpoint 2024-11-02 16:04:21 +01:00
8fed348ff7 refactor: move global config properties to a sub dict 2024-11-02 16:04:21 +01:00
a3db62bb14 Merge pull request #2533 from nginx-proxy/2529
fix: use sha1 hash for config files name when using regex host
2024-11-02 14:11:22 +01:00
4c67b24552 test: rename file for clarity 2024-11-01 21:54:59 +01:00
1cd7b97e8f test: regex vhost file names 2024-11-01 21:37:29 +01:00
5baf4a163f docs: update docs regex file name change 2024-11-01 21:36:00 +01:00
73ba28091a fix: use sha1 hash for config files when using regex host 2024-11-01 20:32:00 +01:00
5ec120a296 docs: TLSv1/TLSv1.1 work on the alpine image too 2024-10-16 12:25:21 +02:00
8417046748 Merge pull request #2510 from liuxiaoy/patch-1
fix: correctly enable TLSv1 and TLSv1.1
2024-10-12 19:33:33 +02:00
ac0a4ca826 docs: warn about TLSv1 / TLSv1.1 being available only on debian 2024-10-06 16:01:58 +02:00
3ba0678ce5 fix: re-enable TLSv1 and TLSv1.1 on relevant policies 2024-10-06 15:45:10 +02:00
4251249761 Merge pull request #2519 from nginx-proxy/dependabot/docker/library/nginx-1.27.2
build: bump library/nginx from 1.27.1 to 1.27.2
2024-10-03 11:38:20 +02:00
e95a66eedf build: bump library/nginx from 1.27.1 to 1.27.2
Bumps library/nginx from 1.27.1 to 1.27.2.

---
updated-dependencies:
- dependency-name: library/nginx
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-03 10:53:25 +02:00
69488808b9 Merge pull request #2520 from nginx-proxy/reject-handshake
fix: reject SSL handshake rather than using empty certificate
2024-10-03 10:23:18 +02:00
712a7ef176 fix: reject SSL handshake rather than using empty certificate 2024-10-03 09:57:20 +02:00
76873746f3 Merge pull request #2512 from nginx-proxy/dependabot/pip/test/requirements/pytest-8.3.3
ci: bump pytest from 8.3.2 to 8.3.3 in /test/requirements
2024-09-20 00:58:36 +02:00
90f6e1b3dc ci: bump pytest from 8.3.2 to 8.3.3 in /test/requirements
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.2 to 8.3.3.
- [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/8.3.2...8.3.3)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 04:44:26 +00:00
246da3ff85 Fix nginx.tmpl when enabled TLSv1 TLSv1.1 2024-09-13 14:23:16 +08:00
1baf048a6e build: bump nginx 1.27.0 to 1.27.1 (#2506)
* build: bump nginx 1.27.0 to 1.27.1

* Update README.md

Link to nginx changelog

Co-authored-by: Nicolas Duchon <nicolas.duchon@gmail.com>

---------

Co-authored-by: Nicolas Duchon <nicolas.duchon@gmail.com>
2024-08-27 21:50:30 +02:00
f100b4426f Merge pull request #2505 from nginx-proxy/dependabot/docker/nginxproxy/docker-gen-0.14.2-debian
build: bump nginxproxy/docker-gen from 0.14.1 to 0.14.2
2024-08-27 07:40:36 +02:00
1c00b898a3 build: bump nginxproxy/docker-gen from 0.14.1-debian to 0.14.2-debian
Bumps nginxproxy/docker-gen from 0.14.1-debian to 0.14.2-debian.

---
updated-dependencies:
- dependency-name: nginxproxy/docker-gen
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-27 05:28:30 +00:00
d4d3f12a41 Merge pull request #2504 from nginx-proxy/dependabot/docker/nginxproxy/forego-0.18.2-debian
build: bump nginxproxy/forego from 0.18.1 to 0.18.2
2024-08-27 07:27:00 +02:00
54a1b0aa25 build: bump nginxproxy/forego from 0.18.1-debian to 0.18.2-debian
Bumps nginxproxy/forego from 0.18.1-debian to 0.18.2-debian.

---
updated-dependencies:
- dependency-name: nginxproxy/forego
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-27 05:13:17 +00:00
83110b24ef Merge pull request #2498 from nginx-proxy/dependabot/docker/nginxproxy/docker-gen-0.14.1-debian
build: bump nginxproxy/docker-gen from 0.14.0 to 0.14.1
2024-07-31 20:39:59 +02:00
dee91b4d93 build: bump nginxproxy/docker-gen from 0.14.0-debian to 0.14.1-debian
Bumps nginxproxy/docker-gen from 0.14.0-debian to 0.14.1-debian.

---
updated-dependencies:
- dependency-name: nginxproxy/docker-gen
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-31 18:25:26 +00:00
c5f054ed36 fix: limit exposed ports in template comment to 10 (#2494)
Co-authored-by: Nicolas Duchon <nicolas.duchon@gmail.com>
2024-07-29 21:00:42 +02:00
290d275a68 Merge pull request #2497 from nginx-proxy/2496
fix: use fastcgi.conf on alpine and fastcgi_params on debien
2024-07-29 18:50:33 +02:00
5f4e77b6e7 fix: use fastcgi.conf on alpine and fastcgi_params on debien 2024-07-29 18:15:04 +02:00
434a089251 Merge pull request #2495 from nginx-proxy/dependabot/pip/test/requirements/pytest-8.3.2
ci: bump pytest from 8.3.1 to 8.3.2 in /test/requirements
2024-07-29 12:28:17 +02:00
5fe52442bb ci: bump pytest from 8.3.1 to 8.3.2 in /test/requirements
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.1 to 8.3.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/8.3.1...8.3.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-29 04:07:25 +00:00
8d47458026 Merge pull request #2493 from nginx-proxy/dependabot/pip/test/requirements/pytest-8.3.1
ci: bump pytest from 8.2.2 to 8.3.1 in /test/requirements
2024-07-22 08:11:55 +02:00
f4ccdbd656 ci: bump pytest from 8.2.2 to 8.3.1 in /test/requirements
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.2.2 to 8.3.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/8.2.2...8.3.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-22 04:05:13 +00:00
31642a748f Merge pull request #2485 from nginx-proxy/dependabot/github_actions/docker/build-push-action-6
ci: bump docker/build-push-action from 5 to 6
2024-06-24 23:37:05 +02:00
261ac6f43b ci: bump docker/build-push-action from 5 to 6
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5 to 6.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v5...v6)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-24 04:26:56 +00:00
b67b434711 Merge pull request #2478 from SchoNie/docs-1.6
docs: update version in README.md
2024-06-12 08:15:09 +02:00
705dfa090b docs: update version in README.md 2024-06-10 09:42:07 +02:00
e6c301a4a5 Merge pull request #2477 from nginx-proxy/dependabot/pip/test/requirements/pytest-8.2.2
ci: bump pytest from 8.2.1 to 8.2.2 in /test/requirements
2024-06-10 08:58:11 +02:00
ff4657181a ci: bump pytest from 8.2.1 to 8.2.2 in /test/requirements
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.2.1 to 8.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/8.2.1...8.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>
2024-06-10 04:59:33 +00:00
477366d9a4 Merge pull request #2475 from pini-gh/pini-fallback-https
fix: nohttp(s) shouldn't disable fallback server
2024-06-09 14:28:35 +02:00
4606b15309 fix: nohttp(s) shouldn't disable fallback server
Say we have two containers:
- `app1` with `HTTPS_METHOD=redirect`
- `app2` with `HTTPS_METHOD=nohttps`

Without this change the fallback answer on an HTTPS request to an unknown
server would change depending on whether `app1` is up (503) or not
(connection refused). This is not wanted.

In case someone doesn't want HTTPS at all, they just have to not bind
port 443.
2024-06-06 22:04:15 +02:00
50608d7826 Merge pull request #2452 from pini-gh/pini-enforce-HTTPS_METHOD
fix: enforce HTTPS_METHOD on missing cert as well
2024-06-06 12:14:38 +02:00
60b123d249 feat: ENABLE_HTTP_ON_MISSING_CERT variable
Default: true
2024-06-06 11:26:17 +02:00
9506e60f43 Merge pull request #2473 from nginx-proxy/enable-acme-challenge
feat: enable acme challenge location handling by default
2024-06-06 08:31:01 +02:00
cea905ff88 docs: typo
Co-authored-by: Niek <100143256+SchoNie@users.noreply.github.com>
2024-06-05 15:55:49 +02:00
714fa25704 style: docs linting 2024-06-05 08:47:39 +02:00
4bd542de99 feat: handle acme challenge location by default 2024-06-05 08:47:11 +02:00
8de923fd33 ci: bump requests from 2.32.2 to 2.32.3 in /test/requirements (#2472)
Bumps [requests](https://github.com/psf/requests) from 2.32.2 to 2.32.3.
- [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.32.2...v2.32.3)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-03 09:36:25 +02:00
7922c925af chore: spelling fixes for #2468 (#2471) 2024-05-31 17:07:07 +02:00
57e86561eb build: bump library/nginx from 1.26.0 to 1.27.0 (#2470)
Bumps library/nginx from 1.26.0 to 1.27.0.

---
updated-dependencies:
- dependency-name: library/nginx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-31 10:28:46 +02:00
9cf736f1f8 feat: variable ACME_HTTP_CHALLENGE_LOCATION (#2468)
Values:
* `legacy` (default): generate location blocks for ACME HTP Challenge
  excepted when `HTTPS_METHOD=noredirect` or there is no certificate for
  the domain
* `true`: generate location blocks for ACME HTP Challenge in all cases
* `false`: do not generate location blocks for ACME HTP Challenge

This feature is currently needed because acme-companion may generate
the HTTP Challenge configuration while it was done already by nginx-proxy
(see #2465#issuecomment-2136361373).

Also sometimes a hardcoded ACME challenge location is not wanted because
the challenge validation is not done with acme-companion / Let's Encrypt,
and with a challenge location setup differently.
2024-05-31 00:10:44 +02:00
e904471cd3 build: bump nginxproxy/docker-gen from 0.13.1-debian to 0.14.0-debian (#2467)
Bumps nginxproxy/docker-gen from 0.13.1-debian to 0.14.0-debian.

---
updated-dependencies:
- dependency-name: nginxproxy/docker-gen
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-28 07:45:00 +02:00
5f3ec18b28 docs: explicit policy on missing certificate (#2465)
* chore/doc: explicit policy on missing certificate

This doesn't change the current nginx-proxy behavior, but makes explicit
the current HTTPS_METHOD policy on missing certificate.

* fix: bad wording about missing certificate

Co-authored-by: Nicolas Duchon <nicolas.duchon@gmail.com>

* docs: typo in suggestion

---------

Co-authored-by: Nicolas Duchon <nicolas.duchon@gmail.com>
2024-05-27 20:50:13 +02:00
0dfc8b7a50 ci: bump requests from 2.31.0 to 2.32.2 in /test/requirements (#2462)
Bumps [requests](https://github.com/psf/requests) from 2.31.0 to 2.32.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.31.0...v2.32.2)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-23 14:04:28 +02:00
7a761e1073 ci: bump docker from 7.0.0 to 7.1.0 in /test/requirements (#2461)
Bumps [docker](https://github.com/docker/docker-py) from 7.0.0 to 7.1.0.
- [Release notes](https://github.com/docker/docker-py/releases)
- [Commits](https://github.com/docker/docker-py/compare/7.0.0...7.1.0)

---
updated-dependencies:
- dependency-name: docker
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-23 13:54:05 +02:00
fb9c3a646a feat: custom default error page (#2430)
* feat: customizable error page

* fix: use regex on catchall root location to fix DEFAULT_ROOT=none test

* docs: custom error pages

* fix: don't use default nginx image error page

* docs: small fix
2024-05-22 08:23:48 +02:00
b4c7ea603e Merge pull request #2460 from nginx-proxy/pin-request
fix: hardcode requests package version to 2.31.0
2024-05-21 13:45:34 +02:00
2a793b2d5b fix: hardcode requests package version to 2.31.0
This reverts commit 1c1f8e8700.
2024-05-21 13:30:34 +02:00
df464bbc81 Merge pull request #2459 from nginx-proxy/dependabot/pip/test/requirements/requests-2.32.1
ci: bump requests from 2.31.0 to 2.32.1 in /test/requirements
2024-05-21 11:24:46 +02:00
1c1f8e8700 ---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-21 09:09:45 +00:00
ce2a78bebf Merge pull request #2455 from nginx-proxy/dependabot/pip/test/requirements/pytest-8.2.1
ci: bump pytest from 8.2.0 to 8.2.1 in /test/requirements
2024-05-20 10:01:12 +02:00
49f0b89fb0 ci: bump pytest from 8.2.0 to 8.2.1 in /test/requirements
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.2.0 to 8.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/8.2.0...8.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>
2024-05-20 04:47:19 +00:00
57501eb13f Merge pull request #2449 from nginx-proxy/fix-fastcgi
fix: include a complete fastcgi_params config
2024-05-17 15:23:58 +02:00
87ce03e3c3 Merge pull request #2451 from nginx-proxy/dependabot/docker/nginxproxy/docker-gen-0.13.1-debian
build: bump nginxproxy/docker-gen from 0.13.0 to 0.13.1
2024-05-16 18:37:34 +02:00
f22b64df79 build: bump nginxproxy/docker-gen from 0.13.0-debian to 0.13.1-debian
Bumps nginxproxy/docker-gen from 0.13.0-debian to 0.13.1-debian.

---
updated-dependencies:
- dependency-name: nginxproxy/docker-gen
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-16 16:23:18 +00:00
8e372c39c2 fix: include a complete fastcgi_params config 2024-05-16 13:11:50 +02:00
f0f71f72f7 ci: login to dockerhub to avoid rate limiting 2024-05-15 21:31:17 +02:00
dcc97b9cff test: ipv6 docker networks 2024-05-15 20:28:08 +02:00
5aea820aaa feat: PREFER_IPV6_NETWORK environment variable 2024-05-15 19:38:18 +02:00
1b4a3b036b Merge pull request #2448 from pini-gh/pini-nohttp-behavior
fix: constistent behavior for `HTTPS_METHOD=nohttp`
2024-05-15 15:09:19 +02:00
91652aac48 fix: constistent behavior for HTTPS_METHOD=nohttp
Without this fix the response of nohttp sites to HTTP requests changes
depending on the existence of at least one HTTP enabled site:
* no HTTP enabled sites -> connection refused
* at least one HTTP enabled site -> 503

This fix ensures the response is always 503.
2024-05-14 22:37:32 +02:00
2564a93966 Merge pull request #2446 from pini-gh/pini-acme-challenge
Improve acme-challenge handling
2024-05-13 22:21:41 +02:00
6c1b532ffb Improve acme-challenge handling
So that there is no need anymore for the Let's Encrypt companion to fiddle
with vhosts nginx configuration.

When `HTTPS_METHOD=nohttp` and the certificate is missing, enforce nohttp
instead of switching to `HTTPS_METHOD=redirect`.
2024-05-13 21:10:48 +02:00
db07d90ad8 Merge pull request #2434 from nginx-proxy/multiport-support
feat: multiport support
2024-05-09 12:29:00 +02:00
8e2642909e Merge pull request #2445 from pini-gh/pini-disambiguate
build: disambiguate base image names
2024-05-08 21:17:59 +02:00
5b1491f464 build: disambiguate base image names
to build with podman / buildah.
2024-05-08 19:54:59 +02:00
fc02a5ae38 Merge pull request #2444 from pini-gh/pini-fix-test-test_build.py
fix 'requirements' path in test/test_build.py
2024-05-08 19:31:01 +02:00
59d5293480 fix 'requirements' path in test/test_build.py
Without this patch the test fails when run from project base directory.
2024-05-08 18:30:11 +02:00
ec405f31d7 Merge pull request #2078 from KagurazakaNyaa/main
Support TCP and UDP proxy
2024-05-08 13:41:31 +02:00
12c4f0c7c2 Support TCP and UDP proxy 2024-05-06 18:55:35 +02:00
be319e6629 docs: typo
Co-authored-by: Niek <100143256+SchoNie@users.noreply.github.com>
2024-05-06 15:34:51 +02:00
99645f104d docs: typo 2024-05-06 14:40:32 +02:00
f964176106 Merge pull request #2438 from p12tic/test-acme-challenge
tests: Add tests for how Let's Encrypt ACME challenge is handled
2024-05-06 12:19:29 +02:00
d6c38a0bab tests: Add tests for how Let's Encrypt ACME challenge is handled
At the moment no changes to functionality are done, only the current
behavior is captured.
2024-05-06 13:07:04 +03:00
1bf7eff04f test: multiport merge with legacy variable 2024-05-05 20:45:43 +02:00
c4c65a4441 Merge pull request #2440 from nginx-proxy/web-image-alpine
test: use python alpine variant as base for web image
2024-05-05 17:48:43 +02:00
be7c4c8c85 fix: do not discard containers without VIRTUAL_PATH
For containers grouped by identical VIRTUAL_HOST,
those with no VIRTUAL_PATH variable were silently discarded
when at least one container with VIRTUAL_PATH existed.
2024-05-05 16:36:04 +02:00
9a76577ebc style: shellcheck linting 2024-05-05 16:31:50 +02:00
1b97b11173 test: use python:3-alpine as base for the web image 2024-05-05 16:31:32 +02:00
8b91f09a9b docs: use examples closer to real life scenarios 2024-05-05 16:15:28 +02:00
d80ca7ec36 test: json syntax for multiports variable 2024-05-05 16:15:28 +02:00
53e9a03ac9 feat: print warning on unparsable VIRTUAL_HOST_MULTIPORTS 2024-05-05 16:15:28 +02:00
0baff189bc refactor: get rid of get_path_info template 2024-05-05 16:15:28 +02:00
8359aa2089 docs: documentation for multiports support 2024-05-05 16:15:28 +02:00
47e2838e61 refactor: rename VIRTUAL_HOST_YAML -> VIRTUAL_HOST_MULTIPORTS 2024-05-05 16:15:27 +02:00
216eae9f70 test: multiports base test 2024-05-05 16:15:27 +02:00
62212186eb test: re-organize test files 2024-05-05 16:15:27 +02:00
62d9c08474 fix: default values if port and dest are missing 2024-05-05 16:15:27 +02:00
fc98f4c953 refactor: cleanup template 2024-05-05 16:15:27 +02:00
87e5b58b77 feat: multiports support using yaml syntax
(See nginx-proxy/nginx-proxy#1504)

Using variable VIRTUAL_HOST_MULTIPORTS as a dictionnary:

key: hostname
value: dictionnary:
  key: path
  value: struct
    port
    dest

When the dictionnary associated with a hostname is empty, default values
apply:
  path = "/"
  port = default port
  dest = ""

For each path entry, port and dest are optionnal and are assigned default
values when missing.

Example:
      VIRTUAL_HOST_MULTIPORTS: |
        host1.example.org:
          "/":
            port: 8000
          "/somewhere":
            port: 9000
            dest: "/elsewhere"
        host2.example.org:
        host3.example.org:
          "/inner/path":
2024-05-05 16:15:26 +02:00
6e771fb3be Merge pull request #2439 from nginx-proxy/dependabot/docker/nginxproxy/docker-gen-0.13.0-debian
build: bump nginxproxy/docker-gen from 0.12.1 to 0.13.0
2024-05-05 16:15:02 +02:00
340f6b0c08 build: bump nginxproxy/docker-gen from 0.12.1-debian to 0.13.0-debian
Bumps nginxproxy/docker-gen from 0.12.1-debian to 0.13.0-debian.

---
updated-dependencies:
- dependency-name: nginxproxy/docker-gen
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-05 14:02:17 +00:00
a4c694fefc feat: basic implementation of ipv6 for ipv6 docker networks 2024-05-03 17:41:07 +02:00
2ac4509a61 Merge pull request #2436 from nginx-proxy/dependabot/docker/nginxproxy/docker-gen-0.12.1-debian
build: bump nginxproxy/docker-gen from 0.12.0 to 0.12.1
2024-05-03 12:57:21 +02:00
b4bceac3fd Merge pull request #2435 from SchoNie/nginx-proxy-tester
tests: add test if nginx-proxy-builder can be build successfully
2024-05-03 12:56:53 +02:00
08f563888d build: bump nginxproxy/docker-gen from 0.12.0-debian to 0.12.1-debian
Bumps nginxproxy/docker-gen from 0.12.0-debian to 0.12.1-debian.

---
updated-dependencies:
- dependency-name: nginxproxy/docker-gen
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-03 10:49:23 +00:00
6602769d9a style: linting 2024-05-03 12:37:53 +02:00
c678cfdddf Apply suggestions from code review
Commited code style consistency suggestions.

Co-authored-by: Nicolas Duchon <nicolas.duchon@gmail.com>
2024-05-03 12:09:40 +02:00
46724e7cb6 tests: add test if nginx-proxy-builder can be build successfully 2024-05-03 11:36:50 +02:00
e46e62e660 Merge pull request #2433 from SchoNie/docs-urls
docs: url fixes
2024-05-03 11:32:25 +02:00
877f243ce2 docs: url fixes
Fix 404 to docker-entrypoint.sh
Add hyperlink to nginx.tmpl reference.
2024-05-03 11:19:07 +02:00
43b8ab82a9 Merge pull request #2432 from SchoNie/webserver-syntaxwarning-fix
fix: tests webserver syntaxwarning
2024-05-03 11:08:46 +02:00
12d639dad7 Change to raw string literal
To fix:
/webserver.py:17: SyntaxWarning: invalid escape sequence '\d'
  elif re.match("/status/(\d+)", self.path):
/webserver.py:18: SyntaxWarning: invalid escape sequence '\d'
  result = re.match("/status/(\d+)", self.path)
2024-05-03 10:49:15 +02:00
1e55d9883f Merge pull request #2429 from nginx-proxy/docs-qol
docs: redordering, grouping and navigation
2024-05-02 17:51:05 +02:00
2ac4540a0d docs: redordering, grouping and navigation 2024-05-02 15:28:24 +02:00
769d58bcfb Merge pull request #2425 from nginx-proxy/dependabot/docker/nginx-1.26.0
build: bump nginx from 1.25.4 to 1.26.0
2024-05-01 13:47:35 +02:00
766db8d942 docs: update nginx version badge 2024-05-01 13:38:32 +02:00
559c43e75e build: bump nginx from 1.25.4 to 1.26.0
Bumps nginx from 1.25.4 to 1.26.0.

---
updated-dependencies:
- dependency-name: nginx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-01 13:38:32 +02:00
0d7aac7c53 Merge pull request #2428 from nginx-proxy/dependabot/pip/test/requirements/pytest-8.2.0
ci: bump pytest from 8.1.1 to 8.2.0 in /test/requirements
2024-05-01 13:25:05 +02:00
103cb7d4ca ci: bump pytest from 8.1.1 to 8.2.0 in /test/requirements
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.1.1 to 8.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/8.1.1...8.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>
2024-04-29 04:03:15 +00:00
94fb8459cd Merge pull request #2410 from pini-gh/pini-refactor-template-3
refactor: add 'ports' dict to the data structure
2024-03-12 21:35:11 +01:00
c7bf75609b Merge pull request #2411 from nginx-proxy/dependabot/pip/test/requirements/pytest-8.1.1
ci: bump pytest from 8.1.0 to 8.1.1 in /test/requirements
2024-03-12 21:12:40 +01:00
3c3b3675c1 Merge pull request #2413 from Huge/patch-1
Update README.md to use 1.5 version and link DockerHub
2024-03-12 21:11:50 +01:00
16b84ea1b5 Update README.md to use 1.5 version and link DockerHub 2024-03-12 14:23:56 +01:00
6441daf25b ci: bump pytest from 8.1.0 to 8.1.1 in /test/requirements
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.1.0 to 8.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/8.1.0...8.1.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-11 04:19:22 +00:00
45770e04bd refactor: add 'ports' dict to the data structure
Nothing changes for the legacy syntax, but adding this level to the data
structure enables advanced port configuration.
2024-03-09 20:13:42 +01:00
26b0a0008b Merge pull request #2408 from nginx-proxy/dependabot/pip/test/requirements/pytest-8.1.0
ci: bump pytest from 8.0.2 to 8.1.0 in /test/requirements
2024-03-04 22:06:21 +01:00
4b38bf259d Merge pull request #2405 from nginx-proxy/refactor-template-2
refactor: template internal data structure
2024-03-04 22:03:30 +01:00
12e1360fc3 ci: bump pytest from 8.0.2 to 8.1.0 in /test/requirements
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.0.2 to 8.1.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/8.0.2...8.1.0)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-04 04:52:02 +00:00
b09575297d docs: typo in comments
Co-authored-by: Niek <100143256+SchoNie@users.noreply.github.com>
2024-02-27 13:27:11 +01:00
418f1a3cd0 fix: don't re-assign variable
Co-authored-by: pini-gh <pini@debian.org>
2024-02-27 13:20:39 +01:00
60618afe52 Merge pull request #2407 from nginx-proxy/dependabot/pip/test/requirements/pytest-8.0.2
ci: bump pytest from 8.0.1 to 8.0.2 in /test/requirements
2024-02-26 08:20:17 +01:00
2a5521625d ci: bump pytest from 8.0.1 to 8.0.2 in /test/requirements
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.0.1 to 8.0.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/8.0.1...8.0.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-26 04:49:11 +00:00
b8b53794bf Merge pull request #2406 from nginx-proxy/dependabot/docker/nginxproxy/docker-gen-0.12.0-debian
build: bump nginxproxy/docker-gen from 0.11.2 to 0.12.0
2024-02-25 11:51:11 +01:00
d588c96dff build: bump nginxproxy/docker-gen from 0.11.2-debian to 0.12.0-debian
Bumps nginxproxy/docker-gen from 0.11.2-debian to 0.12.0-debian.

---
updated-dependencies:
- dependency-name: nginxproxy/docker-gen
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-25 10:42:38 +00:00
f960061e2d Merge pull request #2404 from nginx-proxy/network-host
docs: add comment about host network to compose example
2024-02-25 10:01:02 +01:00
e97be61272 refactor: refactor virtual paths 2024-02-24 21:51:50 +01:00
4d9d067630 refactor: refactor virtual hosts 2024-02-24 21:51:38 +01:00
8c95ed1cc0 docs: add comment about host network to compose example 2024-02-22 05:59:51 -07:00
9d2eeb7273 Merge pull request #2399 from nginx-proxy/dependabot/pip/test/requirements/pytest-8.0.1
ci: bump pytest from 7.4.4 to 8.0.1 in /test/requirements
2024-02-21 17:55:46 +01:00
24592e39a3 Merge pull request #2402 from SchoNie/htpasswd-tests
tests: htpasswd
2024-02-21 08:42:56 +01:00
a9f8a9c32a htpasswd tests 2024-02-21 08:34:38 +01:00
da006557d0 Merge pull request #2400 from SchoNie/tests-remove-obsolete
tests: remove obsolete stress-test
2024-02-21 08:33:58 +01:00
4464269c51 remove obsolete stress-test 2024-02-20 15:21:09 +01:00
b4902f145d Merge pull request #2401 from SchoNie/docs-htpasswd-readability
docs: htpasswd readability
2024-02-19 22:42:24 +01:00
d4438b5a09 prevent double slash 2024-02-19 12:23:19 +01:00
50750bea53 highlight variables similar to other in readme 2024-02-19 12:21:02 +01:00
0dd4f7a8a8 ci: bump pytest from 7.4.4 to 8.0.1 in /test/requirements
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.4.4 to 8.0.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.4.4...8.0.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-19 04:53:15 +00:00
a2a441e1db docs: update nginx badge 2024-02-18 10:08:23 +01:00
5a32bffd6f Merge pull request #2398 from nginx-proxy/dependabot/docker/nginx-1.25.4
build: bump nginx from 1.25.3 to 1.25.4
2024-02-18 09:56:22 +01:00
745a2035cf Merge pull request #2397 from whomobile/patch-1
fix typo README.md
2024-02-16 10:59:15 +01:00
29168655cf build: bump nginx from 1.25.3 to 1.25.4
Bumps nginx from 1.25.3 to 1.25.4.

---
updated-dependencies:
- dependency-name: nginx
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-16 04:25:16 +00:00
2eaf689172 fix typo README.md
ngingx to nginx
2024-02-15 14:37:21 -08:00
e75c2dfb79 build: revert nginx to 1.25.3 (#2396)
* Revert "build: update docs and tests with nginx 1.25.4"

This reverts commit d9b1751f97.

* Revert "build: bump nginx from 1.25.3 to 1.25.4"

This reverts commit 1aef017df2.
2024-02-15 09:50:12 +01:00
020b993654 Merge pull request #2395 from nginx-proxy/dependabot/docker/nginx-1.25.4
build: bump nginx from 1.25.3 to 1.25.4
2024-02-15 08:54:52 +01:00
5583b385cb style: docs linting 2024-02-15 08:41:11 +01:00
d9b1751f97 build: update docs and tests with nginx 1.25.4 2024-02-15 08:40:46 +01:00
1aef017df2 build: bump nginx from 1.25.3 to 1.25.4
Bumps nginx from 1.25.3 to 1.25.4.

---
updated-dependencies:
- dependency-name: nginx
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-15 04:46:02 +00:00
5c0c8c93d8 Merge pull request #2393 from SchoNie/tests-nonstandardport-hostheader
tests: non standard port Host header check
2024-02-13 18:23:14 +01:00
cb59c24470 tests non standard port Host header 2024-02-13 15:24:37 +01:00
887e2e950c Merge pull request #2390 from nginx-proxy/dependabot/docker/nginxproxy/docker-gen-0.11.2-debian
build: bump nginxproxy/docker-gen from 0.11.1 to 0.11.2
2024-02-10 19:25:13 +01:00
3a19382702 build: bump nginxproxy/docker-gen from 0.11.1-debian to 0.11.2-debian
Bumps nginxproxy/docker-gen from 0.11.1-debian to 0.11.2-debian.

---
updated-dependencies:
- dependency-name: nginxproxy/docker-gen
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-10 18:16:49 +00:00
f47c874c5a Merge pull request #2197 from darh/json_log_format
Add more control over log_format config directive
2024-02-10 19:16:11 +01:00
25883ac05f style: remove extra blank lines 2024-02-10 19:04:56 +01:00
62f55b4428 docs: add logging documentation 2024-02-10 19:03:13 +01:00
76778cebb1 refactor: parse LOG_JSON as boolean + avoid unnecessary backticks 2024-02-10 18:40:18 +01:00
8aefce916f tests: fix the json log test compose files 2024-02-10 18:02:42 +01:00
de9809a9e5 Add more control over log_format config directive
Introduces 3 new environmental variables:
 - `LOG_FORMAT`
 - `LOG_FORMAT_ESCAPE`
 - `LOG_JSON`

`LOG_FORMAT` and `LOG_FORMAT_ESCAPE` default to standard values.
When `LOG_JSON` is set, defaults are changed to: `{"time_local":"$time_iso8601","client_ip":"$http_x_forwarded_for","remote_addr":"$remote_addr","request":"$request","status":"$status","body_bytes_sent":"$body_bytes_sent","request_time":"$request_time","upstream_response_time":"$upstream_response_time","upstream_addr":"$upstream_addr","http_referrer":"$http_referer","http_user_agent":"$http_user_agent","request_id":"$request_id"}`and `json`.

See `nginx.tmpl` and https://nginx.org/en/docs/http/ngx_http_log_module.html#log_format for details
2024-02-10 17:39:16 +01:00
e50429e87e Merge pull request #2389 from nginx-proxy/2300
feat: define basic auth for virtual path
2024-02-10 16:33:27 +01:00
fa23c11edb feat: define basic auth for virtual path 2024-02-10 16:24:00 +01:00
df890def7c Merge pull request #2388 from nginx-proxy/2386
fix: add non standard port to Host header
2024-02-10 16:06:46 +01:00
40a347bfae fix: add non standard port to Host header 2024-02-10 15:23:35 +01:00
af56ba2254 Merge pull request #2387 from nginx-proxy/1780
fix: set worker_rlimit_nofile to (worker_connections x 2)
2024-02-10 14:17:40 +01:00
5d10467c42 fix: set worker_rlimit_nofile to (worker_connections x 2) 2024-02-10 13:56:38 +01:00
3d61f47b54 Merge pull request #2383 from lysliu/patch-1
Add s390x support
2024-02-01 11:19:41 +01:00
af5acae58a Add s390x support
Add s390x support

Signed-off-by: Yan Song Liu <lysliu@cn.ibm.com>
2024-02-01 14:42:15 +08:00
e8d95764fb Merge pull request #2381 from nginx-proxy/dependabot/github_actions/peter-evans/dockerhub-description-4
ci: bump peter-evans/dockerhub-description from 3 to 4
2024-01-29 19:59:23 +01:00
bfe9e0ac1d ci: bump peter-evans/dockerhub-description from 3 to 4
Bumps [peter-evans/dockerhub-description](https://github.com/peter-evans/dockerhub-description) from 3 to 4.
- [Release notes](https://github.com/peter-evans/dockerhub-description/releases)
- [Commits](https://github.com/peter-evans/dockerhub-description/compare/v3...v4)

---
updated-dependencies:
- dependency-name: peter-evans/dockerhub-description
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-29 04:35:11 +00:00
d46881fb58 Merge pull request #2321 from theFra985/patch-1
Add support for grpcs protocol
2024-01-16 18:59:45 +01:00
6f042854e1 Merge pull request #2364 from nginx-proxy/keepalive
feat: keepalive auto setting
2024-01-13 11:40:45 +01:00
14347a4178 Merge pull request #2372 from nginx-proxy/add-openssl-back
build: add the openssl cli back to the alpine image
2024-01-10 17:11:52 +01:00
63411b2407 build: add the openssl cli back to the alpine image 2024-01-10 17:00:47 +01:00
b492cae053 Merge pull request #2369 from SchoNie/nginx-proxy-tester-compose
Install docker compose dependencies in nginx-proxy-tester image
2024-01-05 17:44:31 +01:00
329b69fe76 Update test readme 2024-01-05 14:33:05 +01:00
1433daed4d Install docker dependencies in nginx-proxy-tester image 2024-01-05 14:32:11 +01:00
a3de83c7d1 Merge pull request #2365 from nginx-proxy/dependabot/pip/test/requirements/pytest-7.4.4
ci: bump pytest from 7.4.3 to 7.4.4 in /test/requirements
2024-01-01 10:58:15 +01:00
e2bd0d6365 ci: bump pytest from 7.4.3 to 7.4.4 in /test/requirements
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.4.3 to 7.4.4.
- [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.4.3...7.4.4)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-01 04:39:54 +00:00
d12689cd52 docs: keepalive auto setting 2023-12-26 19:10:42 +01:00
2aa35aa637 tests: keepalive auto setting 2023-12-26 19:07:09 +01:00
443ee5202c test: do we get desired number of idle keepalive connections 2023-12-26 18:52:43 +01:00
d56e8f1d8a refactor: $server_found and $servers aren't both needed 2023-12-26 18:43:05 +01:00
7ce72d59a9 feat: add auto keepalive setting 2023-12-26 18:33:28 +01:00
26db13387e refactor: explicitely default keepalive to disabled 2023-12-26 17:58:24 +01:00
35c6b2afe5 Merge pull request #2362 from nginx-proxy/dependabot/docker/nginxproxy/forego-0.18.1-debian
build: bump nginxproxy/forego from 0.17.3 to 0.18.1
2023-12-25 21:26:58 +01:00
beeb80732a docs: mention color disabling 2023-12-25 21:19:02 +01:00
47ee75d780 build: bump nginxproxy/forego from 0.17.3-debian to 0.18.1-debian
Bumps nginxproxy/forego from 0.17.3-debian to 0.18.1-debian.

---
updated-dependencies:
- dependency-name: nginxproxy/forego
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-25 20:12:56 +00:00
53656ffe51 Merge pull request #2360 from nginx-proxy/dependabot/docker/nginxproxy/docker-gen-0.11.1-debian
build: bump nginxproxy/docker-gen from 0.11.0 to 0.11.1
2023-12-25 21:11:57 +01:00
795cc1332b Merge pull request #2358 from nginx-proxy/proxy_buffering
feat: enable proxy_buffering
2023-12-25 20:45:51 +01:00
051c8a5105 build: bump nginxproxy/docker-gen from 0.11.0-debian to 0.11.1-debian
Bumps nginxproxy/docker-gen from 0.11.0-debian to 0.11.1-debian.

---
updated-dependencies:
- dependency-name: nginxproxy/docker-gen
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-25 19:45:00 +00:00
4fbd14f1fd Merge pull request #2359 from nginx-proxy/cleanup-dockerfiles
refactor: cleanup dockerfiles
2023-12-25 20:22:37 +01:00
eb9fca85cf refactor: remove already present or unneeded dependencies 2023-12-25 19:19:57 +01:00
758b43a5b2 refactor: remove unneeded nginx.conf modification
the upstream nginx.conf already has "worker_processes  auto;"
2023-12-25 19:18:00 +01:00
de4cb3d2b0 refactor: move nginx daemon off to procfile 2023-12-25 19:16:10 +01:00
5c1db95551 feat: enable proxy_buffering 2023-12-25 17:27:34 +01:00
4a8aa5db67 docs: fix two links in updated README.md 2023-12-25 11:27:22 +01:00
ac3131844f Merge pull request #2357 from nginx-proxy/split-docs
docs: split documentation
2023-12-25 11:24:43 +01:00
7f43f0a66b docs: split documentation 2023-12-25 11:22:47 +01:00
18e788575d Merge pull request #2356 from nginx-proxy/revert-2355
test: revert "Fix test" and "Sleep longer"
2023-12-24 15:35:52 +01:00
a4ced5b8bd test: revert "Fix test" and "Sleep longer"
This reverts commit 5174495963.
This reverts commit 33ceec07d8.
2023-12-24 00:16:40 +01:00
db27a07741 Merge pull request #2355 from SchoNie/fix-test_restart_while_missing_cert.py-xfails-xpass
Fix xpass and xfails test_restart_while_missing_cert.py
2023-12-23 22:27:46 +01:00
33ceec07d8 Sleep longer 2023-12-22 17:50:09 +01:00
5174495963 Fix test 2023-12-22 17:19:42 +01:00
39db465e65 Merge pull request #2354 from SchoNie/Pytest-color
Pytest color terminal output
2023-12-22 15:21:49 +01:00
c338a7cf22 Color terminal output 2023-12-22 14:37:20 +01:00
4f85eefa46 Merge pull request #2349 from pini-gh/pini-support-docker-compose-v1
Tests: support custom 'docker compose' command
2023-12-20 10:04:07 +01:00
9e77e81e7d Tests: support custom 'docker compose' command
Enable overriding default 'docker compose' command with environment variable
'DOCKER_COMPOSE'. This way docker compose v1 is still supported with:

  $ DOCKER_COMPOSE=docker-compose pytest

This is important because people using the Debian packaged docker compose
are stuck to v1.
2023-12-20 09:30:06 +01:00
a8478d10da Merge pull request #2350 from pini-gh/pini-support-more-python-versions
Fix test case assertion depending on python version
2023-12-19 22:54:42 +01:00
5d2f51dfe2 Fix test case assertion depending on python version 2023-12-19 21:31:19 +01:00
980470377a ci: Docker Hub description update 2023-12-19 20:33:51 +01:00
81798c4d51 Merge pull request #2348 from nginx-proxy/dependabot/docker/nginxproxy/forego-0.17.3-debian
build: bump nginxproxy/forego from 0.17.2-debian to 0.17.3-debian
2023-12-19 20:17:02 +01:00
478940420e Merge pull request #2347 from pini-gh/pini-2310
fix #2310
2023-12-19 20:08:31 +01:00
2c3883ca81 build: bump nginxproxy/forego from 0.17.2-debian to 0.17.3-debian
Bumps nginxproxy/forego from 0.17.2-debian to 0.17.3-debian.

---
updated-dependencies:
- dependency-name: nginxproxy/forego
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-19 19:07:02 +00:00
5d37cab19b ci: add explicit provenance and enable sbom 2023-12-19 19:26:13 +01:00
a2ade38abb fix #2310
Check the '.Internal' network property, because the .Gateway property is
defined for internal networks as well.
2023-12-19 19:21:00 +01:00
57a350364d Merge pull request #2245 from nginx-proxy/build-workflow
ci: image build and publish workflow update
2023-12-19 18:48:14 +01:00
e2997d9fb9 ci: enable gha caching on docker/build-push-action 2023-12-19 18:39:23 +01:00
db55ddcab4 ci: use build matrix rather than separate jobs 2023-12-19 18:39:20 +01:00
41c7646d8c Merge pull request #2346 from nginx-proxy/dependabot/docker/nginxproxy/docker-gen-0.11.0
build: bump nginxproxy/docker-gen from 0.10.7 to 0.11.0
2023-12-19 14:00:12 +01:00
005488886d build: bump nginxproxy/docker-gen from 0.10.7 to 0.11.0
Bumps nginxproxy/docker-gen from 0.10.7 to 0.11.0.

---
updated-dependencies:
- dependency-name: nginxproxy/docker-gen
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-19 12:40:22 +00:00
7d44f98e4f test: remove unused import 2023-12-12 22:16:32 +01:00
1f17a55366 Merge pull request #2340 from nginx-proxy/dependabot/pip/test/requirements/docker-7.0.0 2023-12-12 21:16:15 +00:00
c1617a6fac ci: bump docker from 6.1.3 to 7.0.0 in /test/requirements
Bumps [docker](https://github.com/docker/docker-py) from 6.1.3 to 7.0.0.
- [Release notes](https://github.com/docker/docker-py/releases)
- [Commits](https://github.com/docker/docker-py/compare/6.1.3...7.0.0)

---
updated-dependencies:
- dependency-name: docker
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-12 21:07:53 +00:00
f044423e4e Merge pull request #2343 from nginx-proxy/docker-compose-upgrade
test: replace python docker-compose with docker compose
2023-12-12 22:07:14 +01:00
c4cf0af373 test: fix failing tests 2023-12-12 21:56:27 +01:00
060f09cfce ci: ensure all compose files are valid compose v2 + formatting 2023-12-12 21:56:27 +01:00
b5cac06305 ci: remove python docker-compose 2023-12-12 21:56:24 +01:00
4fb876ed41 Merge pull request #2341 from nginx-proxy/dependabot/github_actions/actions/setup-python-5
ci: bump actions/setup-python from 4 to 5
2023-12-11 12:27:12 +01:00
c06593bdcb ci: bump actions/setup-python from 4 to 5
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-11 04:09:41 +00:00
9380db5e8e Merge pull request #2338 from nginx-proxy/aws-ssl-policies
fix: TLS 1.3 security policies
2023-12-08 23:15:04 +01:00
4c556290f9 fix: enforce TLSv1.3 on Mozilla-Modern SSL policy 2023-12-08 22:41:29 +01:00
c6868ed6be fix: SSL cipher suites / TLSv1.3 2023-12-08 22:06:07 +01:00
ec0d908a44 feat: add AWS TLS 1.3 security policies 2023-12-08 17:59:26 +01:00
2ed32974e0 Merge pull request #2274 from nginx-proxy/ssl-policies
New AWS SSL policies
2023-12-08 17:15:21 +01:00
99aa94aa32 docs: HTML anchors fix 2023-12-08 16:53:27 +01:00
664ba246fd fix: remove unsupported TLSv1.3 from new AWS SSL policies 2023-12-08 16:44:48 +01:00
34655618a6 docs: cleanup SSL policies section 2023-12-08 16:44:47 +01:00
1535227c78 docs: up to date link to AWS ELB SSL policies 2023-12-08 16:44:47 +01:00
099ac04576 feat: add new SSL policies 2023-12-08 16:44:47 +01:00
d05175d1d6 Merge pull request #2278 from nginx-proxy/http3
feat: experimental HTTP/3 support + optional HTTP/2 disabling
2023-12-08 01:40:36 +01:00
3b075e7eed Merge pull request #2336 from nginx-proxy/dependabot/docker/nginxproxy/docker-gen-0.10.7
build: bump nginxproxy/docker-gen from 0.10.6 to 0.10.7
2023-12-08 01:40:23 +01:00
d37eff8329 build: bump nginxproxy/docker-gen from 0.10.6 to 0.10.7
Bumps nginxproxy/docker-gen from 0.10.6 to 0.10.7.

---
updated-dependencies:
- dependency-name: nginxproxy/docker-gen
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-08 00:32:19 +00:00
c4cb1c3797 test: tests for HTTP/3
Co-authored-by: Nicolas Duchon <nicolas.duchon@gmail.com>
Co-authored-by: Niek <100143256+SchoNie@users.noreply.github.com>
2023-12-08 00:48:08 +01:00
ae5beca0fe docs: documentation for HTTP/2 and HTTP/3 support
Co-authored-by: Nicolas Duchon <nicolas.duchon@gmail.com>
Co-authored-by: Patrick Domack <patrickdk@patrickdk.com>
2023-12-08 00:48:08 +01:00
018db70367 refactor: re-organise template for HTTP/3 feature
Co-authored-by: Nicolas Duchon <nicolas.duchon@gmail.com>
Co-authored-by: Niek <100143256+SchoNie@users.noreply.github.com>
2023-12-08 00:48:08 +01:00
b5cc9b1aa2 feat: experimental http3 support
Co-authored-by: Nicolas Duchon <nicolas.duchon@gmail.com>
Co-authored-by: Knapoc <Knapoc@users.noreply.github.com>
2023-12-08 00:48:08 +01:00
5af973b193 feat: optionally disable HTTP/2 2023-12-08 00:48:08 +01:00
7ca3769a39 Merge pull request #2322 from nginx-proxy/dependabot/docker/nginx-1.25.3-alpine
build: bump nginx from 1.25.2-alpine to 1.25.3-alpine
2023-12-08 00:47:06 +01:00
43692bb495 Merge pull request #2306 from nginx-proxy/dependabot/github_actions/docker/build-push-action-5
ci: bump docker/build-push-action from 4 to 5
2023-12-08 00:29:56 +01:00
3f764a5f84 build: bump nginx from 1.25.2-alpine to 1.25.3-alpine
Bumps nginx from 1.25.2-alpine to 1.25.3-alpine.

---
updated-dependencies:
- dependency-name: nginx
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-08 00:28:25 +01:00
a8f5682397 Merge pull request #2324 from nginx-proxy/dependabot/pip/test/requirements/pytest-7.4.3
ci: bump pytest from 7.4.1 to 7.4.3 in /test/requirements
2023-12-08 00:23:29 +01:00
272b6d37e6 Merge pull request #2307 from nginx-proxy/dependabot/github_actions/docker/login-action-3
ci: bump docker/login-action from 2 to 3
2023-12-08 00:22:13 +01:00
67369c16c5 ci: bump docker/build-push-action from 4 to 5
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4 to 5.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-07 23:22:02 +00:00
8fb137cf8b Merge pull request #2305 from nginx-proxy/dependabot/github_actions/docker/metadata-action-5
ci: bump docker/metadata-action from 4 to 5
2023-12-08 00:20:55 +01:00
08abc53bbc Merge pull request #2304 from nginx-proxy/dependabot/github_actions/docker/setup-qemu-action-3
ci: bump docker/setup-qemu-action from 2 to 3
2023-12-08 00:20:23 +01:00
2bbc3e575f Merge pull request #2303 from nginx-proxy/dependabot/github_actions/docker/setup-buildx-action-3
ci: bump docker/setup-buildx-action from 2 to 3
2023-12-08 00:20:05 +01:00
32288f3caa Merge pull request #2296 from nginx-proxy/dependabot/github_actions/actions/checkout-4
ci: bump actions/checkout from 3 to 4
2023-12-08 00:17:20 +01:00
94259dd22c ci: bump pytest from 7.4.1 to 7.4.3 in /test/requirements
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.4.1 to 7.4.3.
- [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.4.1...7.4.3)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-30 04:38:05 +00:00
a5566f5e8f Added support for grpcs protocol 2023-10-22 00:34:32 +02:00
4464afa219 ci: bump docker/login-action from 2 to 3
Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 04:08:20 +00:00
00dbe25e19 ci: bump docker/metadata-action from 4 to 5
Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 4 to 5.
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Upgrade guide](https://github.com/docker/metadata-action/blob/master/UPGRADE.md)
- [Commits](https://github.com/docker/metadata-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: docker/metadata-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 04:08:13 +00:00
9a162ba384 ci: bump docker/setup-qemu-action from 2 to 3
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 2 to 3.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 04:08:10 +00:00
1ea872051e ci: bump docker/setup-buildx-action from 2 to 3
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2 to 3.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 04:08:08 +00:00
3b32dff071 ci: bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-11 04:10:00 +00:00
67ab97ed64 Merge pull request #2292 from nginx-proxy/dependabot/pip/test/requirements/pytest-7.4.1
ci: bump pytest from 7.4.0 to 7.4.1 in /test/requirements
2023-09-04 09:05:03 +02:00
6332fabe37 Merge pull request #2285 from nginx-proxy/dependabot/docker/nginx-1.25.2-alpine
build: bump nginx from 1.25.1-alpine to 1.25.2-alpine
2023-09-04 08:38:45 +02:00
39fb91675f ci: bump pytest from 7.4.0 to 7.4.1 in /test/requirements
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.4.0 to 7.4.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.4.0...7.4.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-09-04 04:53:51 +00:00
e623b68eb3 build: bump nginx from 1.25.1-alpine to 1.25.2-alpine
Bumps nginx from 1.25.1-alpine to 1.25.2-alpine.

---
updated-dependencies:
- dependency-name: nginx
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-16 04:34:23 +00:00
6f0be586b9 Merge pull request #2283 from SchoNie/certificate_bump
Bump create_server_certificate.sh to nginx:1.25.1
2023-07-31 19:07:36 +02:00
0cbc998381 Bump create_server_certificate.sh to nginx:1.25.1 2023-07-31 13:04:19 +02:00
c430825733 Merge pull request #2273 from nginx-proxy/dependabot/docker/nginxproxy/docker-gen-0.10.6-debian
build: bump nginxproxy/docker-gen from 0.10.5 to 0.10.6
2023-07-12 14:25:33 +02:00
cff658a28e build: bump nginxproxy/docker-gen from 0.10.5-debian to 0.10.6-debian
Bumps nginxproxy/docker-gen from 0.10.5-debian to 0.10.6-debian.

---
updated-dependencies:
- dependency-name: nginxproxy/docker-gen
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-12 11:58:05 +00:00
8ee5afec33 Merge pull request #2266 from nginx-proxy/dependabot/docker/nginxproxy/forego-0.17.2-debian
build: bump nginxproxy/forego from 0.17.1 to 0.17.2
2023-07-05 06:05:55 +02:00
19f8d7e375 build: bump nginxproxy/forego from 0.17.1-debian to 0.17.2-debian
Bumps nginxproxy/forego from 0.17.1-debian to 0.17.2-debian.

---
updated-dependencies:
- dependency-name: nginxproxy/forego
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-04 06:27:05 +00:00
6329ea9963 Merge pull request #2267 from nginx-proxy/dependabot/docker/nginxproxy/docker-gen-0.10.5-debian
build: bump nginxproxy/docker-gen from 0.10.4 to 0.10.5
2023-07-04 08:26:32 +02:00
1e02cb7486 build: bump nginxproxy/docker-gen from 0.10.4-debian to 0.10.5-debian
Bumps nginxproxy/docker-gen from 0.10.4-debian to 0.10.5-debian.

---
updated-dependencies:
- dependency-name: nginxproxy/docker-gen
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-04 06:13:58 +00:00
d6234b9b7a docs: update nginx version badge 2023-07-04 08:06:22 +02:00
f2be3c3915 Merge pull request #2261 from nginx-proxy/dependabot/docker/nginx-1.25.1-alpine
build: bump nginx from 1.25.0-alpine to 1.25.1-alpine
2023-07-04 08:04:14 +02:00
45c181b972 build: update template for nginx 1.25.1
http2 on the listen directive have been deprecated and replaced by the server level http2 directive.
2023-07-04 07:54:38 +02:00
104d3fc503 Merge pull request #2263 from nginx-proxy/dependabot/pip/test/requirements/pytest-7.4.0
ci: bump pytest from 7.3.2 to 7.4.0 in /test/requirements
2023-07-04 07:19:29 +02:00
f878cd8c04 ci: bump pytest from 7.3.2 to 7.4.0 in /test/requirements
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.3.2 to 7.4.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.3.2...7.4.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-06-26 04:58:03 +00:00
f9e0cd4f68 build: bump nginx from 1.25.0-alpine to 1.25.1-alpine
Bumps nginx from 1.25.0-alpine to 1.25.1-alpine.

---
updated-dependencies:
- dependency-name: nginx
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-15 04:57:37 +00:00
4304dcd11d Merge pull request #2259 from nginx-proxy/dependabot/pip/test/requirements/pytest-7.3.2
ci: bump pytest from 7.3.1 to 7.3.2 in /test/requirements
2023-06-13 07:52:26 +02:00
893eefc99d ci: bump pytest from 7.3.1 to 7.3.2 in /test/requirements
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.3.1 to 7.3.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.3.1...7.3.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-06-12 04:57:57 +00:00
af62e14bb1 docs: fix typo 2023-06-07 20:21:44 +02:00
c1a2b31f35 Merge pull request #2222 from rot169/support-hostnet-containers
Support containers running --net=host (#1537)
2023-06-07 07:55:28 +02:00
e22caf7df9 doc: typo in documentation 2023-06-07 07:45:01 +02:00
a81d03c555 Merge pull request #2255 from nginx-proxy/dependabot/pip/test/requirements/docker-6.1.3
ci: bump docker from 6.1.2 to 6.1.3 in /test/requirements
2023-06-05 07:25:01 +02:00
bebb3bba86 ci: bump docker from 6.1.2 to 6.1.3 in /test/requirements
Bumps [docker](https://github.com/docker/docker-py) from 6.1.2 to 6.1.3.
- [Release notes](https://github.com/docker/docker-py/releases)
- [Commits](https://github.com/docker/docker-py/compare/6.1.2...6.1.3)

---
updated-dependencies:
- dependency-name: docker
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-05 04:57:33 +00:00
b382d0bbb6 Merge pull request #2250 from SaturnIC-Forks/main
fix: Replace mDNS .local domain with .internal domain
2023-05-30 07:28:13 +02:00
edb58755c9 docs: nginx badge 1.25.0 2023-05-30 07:09:23 +02:00
34751eb148 Merge pull request #2251 from nginx-proxy/dependabot/docker/nginx-1.25.0-alpine
build: bump nginx from 1.23.4-alpine to 1.25.0-alpine
2023-05-30 07:02:20 +02:00
f63e239827 Merge pull request #2252 from nginx-proxy/dependabot/pip/test/requirements/requests-2.31.0
ci: bump requests from 2.30.0 to 2.31.0 in /test/requirements
2023-05-30 06:57:07 +02:00
e34d00f42c ci: bump requests from 2.30.0 to 2.31.0 in /test/requirements
Bumps [requests](https://github.com/psf/requests) from 2.30.0 to 2.31.0.
- [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.30.0...v2.31.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-29 04:57:57 +00:00
3a66659e63 build: bump nginx from 1.23.4-alpine to 1.25.0-alpine
Bumps nginx from 1.23.4-alpine to 1.25.0-alpine.

---
updated-dependencies:
- dependency-name: nginx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-25 04:57:50 +00:00
13eb61a639 fix: Replace mDNS .local domain with .example domain
See RFC 6762 for details on mDNS .local domain: https://datatracker.ietf.org/doc/html/rfc6762
And RFC 6761 for details on .example domain: https://datatracker.ietf.org/doc/html/rfc6761
2023-05-23 09:43:30 +02:00
a06bb9e68b fix: add missing cipher suite to Mozilla-Intermediate (#2247) 2023-05-22 12:21:35 +02:00
ffc8b27c6a Merge pull request #2244 from nginx-proxy/dependabot/pip/test/requirements/docker-6.1.2
ci: bump docker from 6.1.1 to 6.1.2 in /test/requirements
2023-05-15 13:35:30 +02:00
bd5816b705 ci: bump docker from 6.1.1 to 6.1.2 in /test/requirements
Bumps [docker](https://github.com/docker/docker-py) from 6.1.1 to 6.1.2.
- [Release notes](https://github.com/docker/docker-py/releases)
- [Commits](https://github.com/docker/docker-py/compare/6.1.1...6.1.2)

---
updated-dependencies:
- dependency-name: docker
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-15 04:58:28 +00:00
87108892f6 Merge pull request #2238 from nginx-proxy/prebuilt-forego
build: get forego from pre-built image
2023-05-11 10:36:35 +02:00
5d237b7a0a build: get Forego from pre-built image 2023-05-11 01:07:09 -04:00
068bf91e83 Merge pull request #2239 from nginx-proxy/fix-rfc-5746
fix: always on session cache on HTTPS fallback listener
2023-05-11 00:43:24 -04:00
27f6cebb05 docs: host networking support documentation 2023-05-09 21:08:10 +02:00
35b1493e16 feat: support proxy + container in host network mode 2023-05-09 19:31:42 +02:00
b88d33d2f3 feat: handle multiple proxy networks 2023-05-09 00:58:05 +02:00
e2539b04f5 fix: always on session cache on HTTPS fallback listener 2023-05-08 23:14:09 +02:00
9ff197d721 Merge pull request #2237 from nginx-proxy/dependabot/pip/test/requirements/requests-2.30.0
ci: bump requests from 2.29.0 to 2.30.0 in /test/requirements
2023-05-08 21:30:46 +02:00
2b621599ff test: fix wildcard_certs_and_nohttps test 2023-05-08 21:20:47 +02:00
6e5e8f4c9d ci: fix image version labelling 2023-05-08 15:36:04 +02:00
faad1cc29e ci: bump requests from 2.29.0 to 2.30.0 in /test/requirements
Bumps [requests](https://github.com/psf/requests) from 2.29.0 to 2.30.0.
- [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.29.0...v2.30.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-08 10:48:18 +00:00
7679665d99 Merge pull request #2236 from nginx-proxy/dependabot/pip/test/requirements/docker-6.1.1
ci: bump docker from 6.0.1 to 6.1.1 in /test/requirements
2023-05-08 12:47:22 +02:00
28fef687ad ci: bump docker from 6.0.1 to 6.1.1 in /test/requirements
Bumps [docker](https://github.com/docker/docker-py) from 6.0.1 to 6.1.1.
- [Release notes](https://github.com/docker/docker-py/releases)
- [Commits](https://github.com/docker/docker-py/compare/6.0.1...6.1.1)

---
updated-dependencies:
- dependency-name: docker
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-08 04:58:23 +00:00
7dd32e3ed3 Merge pull request #2232 from nginx-proxy/dependabot/docker/golang-1.20.4-alpine
build: bump golang from 1.20.3-alpine to 1.20.4-alpine
2023-05-03 19:54:13 +02:00
d2e62c2013 Merge pull request #2231 from nginx-proxy/remove-wget
build: don't install wget inside images
2023-05-03 07:36:25 +02:00
442e577c0e build: bump golang from 1.20.3-alpine to 1.20.4-alpine
Bumps golang from 1.20.3-alpine to 1.20.4-alpine.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-03 04:57:51 +00:00
64e21100d3 build: don't install wget 2023-05-02 05:33:39 +02:00
0501c54002 build: get docker-gen from pre-built image (#2230)
* build: get docker-gen from pre-built image

* build: requested changes
2023-05-02 05:21:41 +02:00
c337a13847 Merge pull request #2229 from nginx-proxy/workflow-rename
ci: rename build / publish workflow
2023-04-30 16:34:23 +02:00
eabb808b85 ci: rename build / publish workflow 2023-04-30 15:51:46 +02:00
0853fada32 Merge pull request #2228 from nginx-proxy/dependabot/github_actions/docker/build-push-action-4
ci: bump docker/build-push-action from 3 to 4
2023-04-30 15:41:13 +02:00
2218f98af2 Merge pull request #2227 from nginx-proxy/dependabot/github_actions/actions/setup-python-4
ci: bump actions/setup-python from 2 to 4
2023-04-30 15:40:59 +02:00
70c9ea6ccc ci: bump actions/setup-python from 2 to 4
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 4.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-30 15:31:43 +02:00
4655ba9f51 ci: only trigger test workflow on push for main branch 2023-04-30 15:30:29 +02:00
edb6c5dfd8 ci: bump docker/build-push-action from 3 to 4
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3 to 4.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-30 13:17:20 +00:00
4a096a25a8 Merge pull request #2226 from nginx-proxy/dependabot-actions
ci: maintain GitHub Actions with Dependabot
2023-04-30 15:16:53 +02:00
43eed7d0df ci: check test suite dependencies weekly 2023-04-30 15:02:44 +02:00
21321a4495 ci: add GitHub Actions to Dependabot config 2023-04-30 15:02:09 +02:00
882e9a3b3c test: add tests for host mode fix 2023-04-28 22:43:20 +02:00
6ef3196d30 Merge pull request #2225 from nginx-proxy/dependabot/pip/test/requirements/requests-2.29.0
ci: bump requests from 2.28.2 to 2.29.0 in /test/requirements
2023-04-27 18:41:07 +02:00
00a1e5ef5c ci: bump requests from 2.28.2 to 2.29.0 in /test/requirements
Bumps [requests](https://github.com/psf/requests) from 2.28.2 to 2.29.0.
- [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.2...v2.29.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-27 05:00:28 +00:00
325fd01ebb Support containers running --net=host (#1537)
Detect if a target container is running host networking, and if so, use the IP address of the first bridge net gateway.
2023-04-23 14:09:33 +01:00
b4efff04b7 Merge pull request #2220 from nginx-proxy/docker-gen-0.10.4
build: dockergen 0.10.3 -> 0.10.4
2023-04-18 08:10:11 +02:00
9f735aab82 build: dockergen 0.10.3 -> 0.10.4 2023-04-18 07:58:38 +02:00
ff676b519e Merge pull request #2219 from nginx-proxy/dependabot/pip/test/requirements/pytest-7.3.1
ci: bump pytest from 7.3.0 to 7.3.1 in /test/requirements
2023-04-18 07:20:04 +02:00
89c3c89f60 Merge pull request #2214 from rhansen/default_server
fix: Remove `default_server` listen option from fallback server
2023-04-17 13:34:14 -04:00
b34c917977 ci: bump pytest from 7.3.0 to 7.3.1 in /test/requirements
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.3.0 to 7.3.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.3.0...7.3.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-04-17 05:01:01 +00:00
035bd2b5ac fix: Remove default_server listen option from fallback server
This fixes a bug introduced in commit
9b4bb07b34.
2023-04-13 01:16:54 -04:00
1f3508e6df Merge pull request #2216 from nginx-proxy/dependabot/pip/test/requirements/pytest-7.3.0
ci: bump pytest from 7.2.2 to 7.3.0 in /test/requirements
2023-04-10 07:35:41 +02:00
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
7322a2d542 Merge pull request #2213 from nginx-proxy/dependabot/docker/golang-1.20.3-alpine
build: bump golang from 1.20.2-alpine to 1.20.3-alpine
2023-04-05 07:19:43 +02:00
a3d3baf259 build: bump golang from 1.20.2-alpine to 1.20.3-alpine
Bumps golang from 1.20.2-alpine to 1.20.3-alpine.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-05 04:58:03 +00:00
130fd908fb docs: update nginx version badge 2023-03-30 20:58:56 +02:00
3039d85ee7 Merge pull request #2206 from nginx-proxy/dependabot/docker/nginx-1.23.4-alpine
build: bump nginx from 1.23.3-alpine to 1.23.4-alpine
2023-03-30 20:58:00 +02:00
c35368007e Merge pull request #2207 from nginx-proxy/docker-gen-0.10.3
build: docker-gen 0.10.2 -> 0.10.3
2023-03-30 01:25:27 +02:00
2056dc4429 build: dockergen 0.10.2 -> 0.10.3 2023-03-30 01:10:05 +02:00
87ffa7a5a8 build: bump nginx from 1.23.3-alpine to 1.23.4-alpine
Bumps nginx from 1.23.3-alpine to 1.23.4-alpine.

---
updated-dependencies:
- dependency-name: nginx
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-29 04:58:26 +00:00
0d9cd2b45c Merge pull request #2186 from rhansen/fallback
fix: Improve handling of unknown hosts and missing certs
2023-03-24 14:18:52 +01:00
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
55d53e6659 Merge pull request #1934 from rhansen/keepalive
feat: Add support for HTTP keep-alive between the proxy and upstream
2023-03-21 07:31:13 +01:00
6c2d17586b Merge pull request #2200 from nginx-proxy/docker-gen-0.10.2
build: dockergen 0.10.1 -> 0.10.2
2023-03-21 07:27:48 +01:00
4696944245 build: dockergen 0.10.1 -> 0.10.2 2023-03-21 07:15:34 +01:00
49bb37dfdb feat: Add support for HTTP keep-alive between the proxy and upstream 2023-03-14 04:20:17 -04:00
1f855fc7b3 Merge pull request #2191 from rhansen/nil-currentcontainer
fix: Don't error if `$globals.CurrentContainer` is `nil`
2023-03-14 06:49:21 +01:00
364beed773 fix: Don't error if $globals.CurrentContainer is nil
Also:
  * Note when there are no networks.
  * Fix "networks available" comment.
2023-03-10 15:23:44 -05:00
51fd6918ca Merge pull request #2188 from nginx-proxy/dependabot/docker/golang-1.20.2-alpine
build: bump golang from 1.20.1-alpine to 1.20.2-alpine
2023-03-08 15:00:19 -05:00
9906ccda42 build: bump golang from 1.20.1-alpine to 1.20.2-alpine
Bumps golang from 1.20.1-alpine to 1.20.2-alpine.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-08 04:58:06 +00:00
d990354e3d Merge pull request #2187 from nginx-proxy/dependabot/pip/test/requirements/pytest-7.2.2
ci: bump pytest from 7.2.1 to 7.2.2 in /test/requirements
2023-03-06 15:50:46 -05:00
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
abcef6be86 Merge pull request #2184 from nginx-proxy/dockergen-0.10.1
build: dockergen 0.10.0 -> 0.10.1
2023-02-28 08:50:19 +01:00
6e9d46e672 Merge pull request #2164 from rhansen/tests
chore: minor test improvements
2023-02-28 08:49:12 +01:00
16b8cde8e4 build: dockergen 0.10.0 -> 0.10.1 2023-02-28 08:36:27 +01:00
afd6544702 Merge pull request #2179 from rhansen/swarm
fix: Partially revert "chore: Remove support for legacy swarm"
2023-02-28 07:40:16 +01:00
4fc17d6139 Merge pull request #2183 from JanMalte/patch-1
fix: Sort networks and ports before iterating
2023-02-21 00:56:06 -05:00
37134c44d7 fix: Sort networks and ports before iterating
This avoids unnecessary nginx restarts caused by config file churn.
2023-02-21 00:22:47 -05:00
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
4d8f878ba7 tests: Fixture that simplifies Docker compose file changes 2023-02-17 02:34:08 -05:00
f5a3492926 tests: Factor out DNS monkey patching to its own fixture 2023-02-17 02:34:08 -05:00
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
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
6207be5f8f fix: Partially revert "chore: Remove support for legacy swarm"
This partially reverts commit 2494e20784
by ignoring any network named "ingress" when searching for a
container's IP address.

That commit was technically a backwards-incompatible change: Some
users use nginx-proxy with Swarm mode even though it is not fully
supported.  In such cases nginx-proxy should ignore the `ingress`
network, otherwise nginx will not be able to reach the
server (container-to-container traffic apparently doesn't work over
the Swarm `ingress` network).

The parts of that commit that examine the `SwarmNode` structure are
not reverted here because docker-gen does not currently populate that
structure -- not even when both docker-gen and the service task
container are running on the same manager node.
2023-02-17 01:52:05 -05:00
6f2a549ef1 Merge pull request #2175 from nginx-proxy/dependabot/docker/golang-1.20.1
build: bump golang from 1.20.0 to 1.20.1
2023-02-15 03:47:19 -05:00
de4386e440 build: bump golang from 1.20.0 to 1.20.1
Bumps golang from 1.20.0 to 1.20.1.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-15 04:57:57 +00:00
bc2ada1f44 Merge pull request #2163 from nginx-proxy/dockergen-0.10.0
build: dockergen 0.9.4 -> 0.10.0
2023-02-09 08:28:09 +01:00
c10c7bcbe9 build: dockergen 0.9.4 -> 0.10.0 2023-02-09 08:10:43 +01:00
41e025f0f0 Merge pull request #2159 from rhansen/refactor
chore: Factor out container IP:port lookup
2023-02-09 08:01:26 +01:00
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
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
16066cab61 fix: Don't create cert error https server if https is not enabled 2023-02-02 17:17:00 -05:00
ee8d2cede4 Merge pull request #2162 from nginx-proxy/dependabot/docker/golang-1.20.0
build: bump golang from 1.19.5 to 1.20.0
2023-02-02 02:20:26 -05:00
7b6b2f773d build: bump golang from 1.19.5 to 1.20.0
Bumps golang from 1.19.5 to 1.20.0.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-02 04:01:39 +00:00
18d0671312 chore: Factor out duplicate checks for default.crt
for improved readability.
2023-02-01 18:56:16 -05:00
7a2b1f8833 chore: Split $is_https variable into two separate checks
for improved readability.
2023-02-01 18:17:43 -05:00
11a46f728c chore: Factor out container IP:port lookup
This will make planned future changes easier.
2023-02-01 03:06:39 -05:00
2494e20784 chore: Remove support for legacy swarm
It doesn't work with the newer Docker Swarm mode so it doesn't have
much value anymore.
2023-02-01 03:04:37 -05:00
1462ff019d Merge pull request #1179 from harvdogg/master
Allow complete override of location blocks
2023-02-01 07:42:42 +01:00
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
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
926bd43cff Merge pull request #2153 from rhansen/upstream-cleanup
fix: Generate at most one `server` directive per container
2023-01-30 07:56:50 +01:00
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
6162427c45 fix: Generate at most one server directive per container 2023-01-28 18:01:19 -05:00
bcec2d9075 chore: Refactor upstream template for readability
In particular, reduce the nesting depth to make it easier to
understand what the code is doing by:

  * converting an $O(nm)$ nested loop into two serial $O(n)+O(m)$
    loops, and
  * consolidating similar nested `if` cases.
2023-01-28 18:01:19 -05:00
daeed502cb feat: Add a warning comment if the container port is published 2023-01-28 18:01:19 -05:00
5a8a6ceae2 chore: Improve debug comments in upstream template 2023-01-28 18:01:19 -05:00
2760ead490 chore: Remove warning comment when port is not exposed
Exposing ports is largely deprecated because it doesn't actually do
anything in Docker.
2023-01-28 18:01:19 -05:00
e97bf606c8 chore: Move version comment to the top of the template
to ensure that the version is always the first output line.

Also, always output `# nginx-proxy`, even if the version isn't known.
This makes it easier to find the start of the generated config in the
output of `nginx -T`.
2023-01-28 18:01:19 -05:00
d6d53893e8 Merge pull request #2152 from vincent-herlemont/documentation-log-format
Documentation custom log format.
2023-01-28 03:32:21 -05:00
aa50116272 Documentation custom log format. 2023-01-27 23:16:49 +01:00
07cc80ac6b feat: Support LOG_FORMAT env variable (#2151) 2023-01-27 12:28:40 -05:00
8346b68a28 fix: Ignore VIRTUAL_HOST set to the empty string
Fixes #2144
2023-01-23 20:48:16 -05:00
f8ae0a4b00 feat: DEFAULT_ROOT=none disables the default location / block 2023-01-23 20:47:00 -05:00
d3ded293ac Merge pull request #2147 from nginx-proxy/dockergen-0.9.4
build: dockergen 0.9.3 -> 0.9.4
2023-01-24 00:27:54 +01:00
fa52426d54 ci: set Dependabot commit prefixs 2023-01-23 23:24:58 +01:00
8df67cdde8 build: dockergen 0.9.3 -> 0.9.4 2023-01-23 23:14:42 +01:00
98b6473c84 Merge pull request #2141 from rhansen/debug
feat: Unconditionally produce debug comments
2023-01-21 19:02:27 -05:00
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
1775420592 Merge pull request #2140 from rhansen/tests
Minor test fixes
2023-01-18 08:02:02 +01:00
92e1a6567e tests: Remove extraction of nginx.tmpl (now unnecessary) 2023-01-17 18:02:30 -05:00
486addd144 tests: Bind-mount the entire nginx-proxy directory in the container 2023-01-17 18:02:30 -05:00
569953521a tests: Exit non-zero if creation of nginx-proxy-tester image fails 2023-01-17 18:02:30 -05:00
55cfae9636 tests: Avoid unnecessary bashisms 2023-01-17 18:02:30 -05:00
d56b5b370d tests: Whitespace fixes 2023-01-17 18:02:30 -05:00
26b0b05f73 tests: Fix test_debug/* tests when IPv6 is enabled 2023-01-17 18:02:29 -05:00
5d22134ee6 Merge pull request #2137 from nginx-proxy/dockergen-0.9.3
build: dockergen 0.9.2 -> 0.9.3
2023-01-17 08:35:18 +01:00
b16ad27878 build: dockergen 0.9.2 -> 0.9.3 2023-01-17 08:17:02 +01:00
017a731302 Merge pull request #2127 from rhansen/chores
Various code health chores
2023-01-17 07:44:57 +01:00
2427b383b5 chore: Move global variables to a $globals dict
Planned future changes will introduce more embedded templates, and the ability
to pass the globals to the templates will be useful.
2023-01-17 00:42:20 -05:00
1b253cd908 chore: Wrap long comments 2023-01-17 00:42:20 -05:00
0da38122bd chore: Consistent indentation 2023-01-17 00:42:20 -05:00
f20662eeaa chore: Use {{- instead of {{ to clean up whitespace 2023-01-17 00:42:20 -05:00
d6d8b2205f chore: Fix comment terminators 2023-01-17 00:42:20 -05:00
4651bf411d chore: Fix comment for $proxy_connection variable 2023-01-17 00:42:20 -05:00
744bd82c54 chore: Combine identical HTTP and HTTPS servers 2023-01-17 00:42:20 -05:00
491642b1e9 chore: Factor out duplicate virtual path code 2023-01-17 00:42:20 -05:00
14d0f3f222 chore: Rename $container to $containers
The value is actually a slice/array of containers so it should be
pluralized.
2023-01-17 00:42:20 -05:00
05423c681a fix: Use parseBool to parse boolean strings 2023-01-17 00:42:20 -05:00
c117ae8fd8 chore: Use boolean for $server_found variable 2023-01-17 00:42:20 -05:00
05eee4b7a3 Merge pull request #2136 from nginx-proxy/dependabot/pip/test/requirements/pytest-7.2.1
chore(deps): bump pytest from 7.2.0 to 7.2.1 in /test/requirements
2023-01-16 23:28:47 -05:00
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
cc9edec1c6 Merge pull request #2134 from nginx-proxy/dependabot/pip/test/requirements/requests-2.28.2
chore(deps): bump requests from 2.28.1 to 2.28.2 in /test/requirements
2023-01-13 16:35:16 -05:00
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
3531fa4d37 Merge pull request #2132 from nginx-proxy/dependabot/docker/golang-1.19.5
chore(deps): bump golang from 1.19.4 to 1.19.5
2023-01-11 14:10:23 -05:00
146b7933a9 chore(deps): bump golang from 1.19.4 to 1.19.5
Bumps golang from 1.19.4 to 1.19.5.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-11 04:03:07 +00:00
2f898566fc Merge pull request #2121 from rhansen/patch-X-Forwarded-Host
feat: Add proxy header `X-Forwarded-Host`
2022-12-27 09:58:48 +01: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
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
7c0d38cd2e Merge pull request #1985 from hiqdev/networks-order
Make sure networks order is the same
2022-12-26 16:59:41 +01:00
cb82aad4c0 Merge pull request #2118 from nginx-proxy/dockergen-0.9.2
build: dockergen 0.9.1 -> 0.9.2
2022-12-23 19:53:27 +01:00
ba8f5a4eb8 build: dockergen 0.9.1 -> 0.9.2 2022-12-23 19:45:04 +01:00
ee0d68c34e docs: nginx badge 1.23.2 -> 1.23.3 2022-12-23 19:42:48 +01:00
216e0b5e12 Merge pull request #2110 from nginx-proxy/dependabot/docker/golang-1.19.4
chore(deps): bump golang from 1.18.8 to 1.19.4
2022-12-23 19:41:21 +01:00
aadeabe4a6 Merge pull request #2115 from nginx-proxy/dependabot/docker/nginx-1.23.3
chore(deps): bump nginx from 1.23.2 to 1.23.3
2022-12-21 00:24:14 +01:00
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
5f15f04556 docs: Document the request headers sent to the backend server 2022-12-19 02:48:01 -05:00
9cb21132a4 docs: Sync README.md with default proxy.conf settings 2022-12-19 02:48:01 -05:00
1aadd9ba8c chore(deps): bump nginx from 1.23.2 to 1.23.3
Bumps nginx from 1.23.2 to 1.23.3.

---
updated-dependencies:
- dependency-name: nginx
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-14 04:02:52 +00:00
f1fb85865d chore(deps): bump golang from 1.18.8 to 1.19.4
Bumps golang from 1.18.8 to 1.19.4.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-07 04:02:52 +00:00
9c2b2cec38 ci: use actions/checkout@v3 2022-12-03 19:36:31 +01:00
9f9e5b8cd4 ci: update Actions versions 2022-12-03 14:34:15 +01:00
02d3a37cfb style: linting on CI yaml files 2022-12-03 14:30:40 +01:00
75c7b1399b build: golang 1.18.1 -> 1.18.8 2022-12-02 00:21:56 +01:00
284a935f3c Merge pull request #2102 from nginx-proxy/dockergen-0.9.1
build: dockergen 0.9.0 -> 0.9.1
2022-12-01 23:44:14 +01:00
050d9da7bd docs: nginx badge 1.21.6 -> 1.23.2 2022-12-01 23:24:53 +01:00
b4dd1a4ba8 build: dockergen 0.9.0 -> 0.9.1 2022-12-01 23:22:02 +01:00
22d58656a0 Merge pull request #2042 from valerebron/patch-1
Simple mistake in DEFAULT_ROOT variable name
2022-12-01 22:54:18 +01:00
7a1fe49841 Merge pull request #2081 from nginx-proxy/dependabot/pip/test/requirements/docker-6.0.1
chore(deps): bump docker from 5.0.3 to 6.0.1 in /test/requirements
2022-12-01 22:11:37 +01:00
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
4f11827752 Merge pull request #2058 from nginx-proxy/dependabot/pip/test/requirements/backoff-2.2.1
chore(deps): bump backoff from 1.11.1 to 2.2.1 in /test/requirements
2022-12-01 15:29:28 +01:00
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
91fac60aae Merge pull request #2008 from nginx-proxy/dependabot/pip/test/requirements/requests-2.28.1
chore(deps): bump requests from 2.27.1 to 2.28.1 in /test/requirements
2022-12-01 14:01:00 +01:00
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
515c736d5a Merge pull request #2077 from nginx-proxy/dependabot/pip/test/requirements/pytest-7.2.0
chore(deps): bump pytest from 7.1.2 to 7.2.0 in /test/requirements
2022-12-01 13:00:08 +01:00
14ccabf45a Merge pull request #2072 from nginx-proxy/dependabot/docker/nginx-1.23.2
chore(deps): bump nginx from 1.21.6 to 1.23.2
2022-12-01 12:50:00 +01:00
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
0fbd71362b chore(deps): bump nginx from 1.21.6 to 1.23.2
Bumps nginx from 1.21.6 to 1.23.2.

---
updated-dependencies:
- dependency-name: nginx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-20 04:07:57 +00:00
9218caef71 Simple mistake in DEFAULT_ROOT variable name
`DEFAUL_ROOT` should be `DEFAULT_ROOT`
2022-08-23 12:45:45 +02:00
510d376f00 Make sure networks order is the same 2022-05-11 12:56:18 +00:00
c4ad18fecc Merge pull request #1971 from nginx-proxy/dependabot/pip/test/requirements/pytest-7.1.2
chore(deps): bump pytest from 7.1.1 to 7.1.2 in /test/requirements
2022-04-26 07:55:46 +02:00
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
70d33d976b Merge pull request #1939 from ntnj/main
chore: indent location, upstream in template
2022-04-18 16:16:00 +02:00
705b29c14f Merge pull request #1960 from nginx-proxy/dependabot/docker/golang-1.18.1
chore(deps): bump golang from 1.18.0 to 1.18.1
2022-04-18 15:52:55 +02:00
998d56c473 chore: indent location, upstream in template 2022-04-14 13:32:58 +05:30
ae0faa43cd chore(deps): bump golang from 1.18.0 to 1.18.1
Bumps golang from 1.18.0 to 1.18.1.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-14 04:10:10 +00:00
2f82265891 Merge pull request #1940 from nginx-proxy/dockergen-0.9.0
Bump docker-gen from 0.8.4 to 0.9.0
2022-04-10 13:35:44 +02:00
2e1da37f9a build: bump docker-gen from 0.8.4 to 0.9.0 2022-04-10 13:15:02 +02:00
576ccc7009 Merge pull request #1933 from nginx-proxy/dockergen-0.8.4
Bump docker-gen from 0.8.2 to 0.8.4
2022-04-10 12:58:42 +02:00
6a0a1f6782 build: bump docker-gen from 0.8.2 to 0.8.4 2022-03-25 11:05:17 +01:00
0442ed9b72 Merge pull request #1929 from nginx-proxy/dependabot/pip/test/requirements/pytest-7.1.1
chore(deps): bump pytest from 7.0.1 to 7.1.1 in /test/requirements
2022-03-23 16:38:10 +01:00
d851908c67 Merge pull request #1931 from rhansen/http-port
Fix IPv6 HTTP listen port
2022-03-23 16:37:47 +01:00
55d913255d Fix IPv6 HTTP listen port 2022-03-20 18:54:07 -04:00
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
4ea3437dfa chore: include license into the Docker images 2022-03-09 12:05:56 +01:00
6b48e11e5c Merge pull request #1444 from pini-gh/app-folder
Do not copy useless files into the image
2022-03-07 16:22:39 +01:00
fea6cc7537 chore: update .dockerignore 2022-03-07 16:01:15 +01:00
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
3257177d80 fix: remove outdated comment from Dockerfiles 2022-03-07 14:14:16 +01:00
5ee6db5e3e ci: remove dev branch build, fix build on tags 2022-03-07 14:12:26 +01:00
46eed825f1 Merge pull request #1917 from nginx-proxy/dependabot/docker/golang-1.17.8
chore(deps): bump golang from 1.17.7 to 1.17.8
2022-03-07 10:06:46 +01:00
0ea8a08761 chore(deps): bump golang from 1.17.7 to 1.17.8
Bumps golang from 1.17.7 to 1.17.8.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-07 04:11:51 +00:00
993e5f8282 ci: publish the alpine image to ghcr.io too 2022-03-04 11:10:14 +01:00
5ab320d82a ci: publish Docker images to ghcr.io 2022-03-04 10:59:50 +01:00
fb8ddfd08c Merge pull request #1884 from nginx-proxy/dependabot/docker/golang-1.17.7
chore(deps): bump golang from 1.16.7 to 1.17.7
2022-02-24 16:48:24 +01:00
fee27ea712 docs: nginx badge 1.21.5 -> 1.21.6 2022-02-24 16:43:45 +01:00
061d129b1b chore(deps): bump golang from 1.16.7 to 1.17.7
Bumps golang from 1.16.7 to 1.17.7.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-24 15:39:59 +00:00
e85ff32f35 Merge pull request #1902 from nginx-proxy/dockergen-0.8.2
Bump docker-gen to 0.8.2
2022-02-24 16:39:15 +01:00
621e703fad build: docker-gen main -> 0.8.2 2022-02-24 16:21:10 +01:00
55651bba8b Merge pull request #1901 from nginx-proxy/dev
Path based routing (VIRTUAL_PATH)
2022-02-24 16:15:50 +01:00
0185a2971c tests: fix virtual path tests for new dhparam 2022-02-24 15:21:14 +01:00
b6b7133a2e fix: minor fixes on nginx template 2022-02-24 15:17:47 +01:00
01446472dd Revert "ci: use docker-gen main on dev branch tests"
This reverts commit b6e9cdc065.
2022-02-24 15:08:45 +01:00
08c9586346 fix: Handle VIRTUAL_PROTO on virtual path basis 2022-02-24 15:08:18 +01:00
7ede0fa4b9 test: fix: Rename new test files 2022-02-24 15:08:18 +01:00
2509fc1076 test: Add test cases for NETWORK_ACCESS=internal 2022-02-24 15:08:18 +01:00
28c74e8dae fix: Move NETWORK_ACCESS to location block 2022-02-24 15:08:18 +01:00
6a580ad664 test: Add test case for location config priority 2022-02-24 15:08:18 +01:00
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
e08b3487c9 test: Add test to cover SSL of path-based routing 2022-02-24 15:08:18 +01:00
12887a977b docs: update DEFAULT_ROOT documentation
Co-authored-by: Jonathan Underwood <junderwood@bitcoinbank.co.jp>
2022-02-24 15:08:17 +01:00
efb250da01 fix: use most specific custom location config first
Co-authored-by: Jonathan Underwood <junderwood@bitcoinbank.co.jp>
2022-02-24 15:08:17 +01:00
c75622db87 docs: fix typo in README.md
Co-authored-by: Jonathan Underwood <junderwood@bitcoinbank.co.jp>
2022-02-24 15:08:17 +01:00
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
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
9df330e51e feat: Add user customizable default root response 2022-02-24 15:08:15 +01:00
28c73e5b52 fix: non working https with virtual path 2022-02-24 15:07:49 +01:00
dad4a2d7bf docs: remove unnecessary word 2022-02-24 15:07:49 +01:00
9cd85f61d5 build: build and push the dev branch to Dockerhub 2022-02-24 15:07:47 +01:00
e0e1732842 docs: Add documentation for path-based routing
Co-authored-by: Josh Trow <josh.trow@gmail.com>
Co-authored-by: Adrian <WolfspiritM@users.noreply.github.com>
Co-authored-by: Rodrigo Aguilera <hi@rodrigoaguilera.net>
Co-authored-by: Alexander Lieret <alexander.lieret@fau.de>
2022-02-24 15:07:02 +01:00
fc4c4e17ca ci: Add tests for the virtual-path routing
@gregsymons test cases were too outdated to be ported easily. The new
tests should include the coverage of the old ones.
2022-02-24 15:07:02 +01:00
2901b917a0 feat: support for path-based routing
Co-authored-by: Josh Trow <josh.trow@gmail.com>
Co-authored-by: Adrian <WolfspiritM@users.noreply.github.com>
Co-authored-by: Rodrigo Aguilera <hi@rodrigoaguilera.net>
Co-authored-by: Alexander Lieret <alexander.lieret@fau.de>
2022-02-24 15:06:57 +01:00
b6e9cdc065 ci: use docker-gen main on dev branch tests 2022-02-24 15:05:52 +01:00
9cdb8047bf Merge pull request #1895 from seitenwerke/feature/add-container-logs
Add container logs in case testcontainer exited unexpectedly
2022-02-22 08:41:29 +01:00
18027fa71b Add container logs in case testcontainer exited unexpectedly 2022-02-20 15:10:05 +01:00
3670d39b71 docs: xip.io -> nip.io 2022-02-15 11:12:52 +01:00
4c622708bd Merge pull request #1888 from nathanweeks/patch-1
Fix path to default.conf in README.md
2022-02-14 16:19:33 +01:00
15e33a3de5 docs: suggest alternatives to xip.io
Fixes #1887
2022-02-14 16:18:25 +01:00
098e551c35 Fix path to default.conf in README.md 2022-02-14 07:42:46 -05:00
fdc90a49be Merge pull request #1886 from nginx-proxy/dependabot/pip/test/requirements/pytest-7.0.1
chore(deps): bump pytest from 7.0.0 to 7.0.1 in /test/requirements
2022-02-14 09:07:18 +01:00
42535c01d9 chore(deps): bump pytest from 7.0.0 to 7.0.1 in /test/requirements
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.0.0 to 7.0.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.0...7.0.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-14 04:20:00 +00:00
f70d81be66 Merge pull request #1882 from nginx-proxy/dependabot/pip/test/requirements/pytest-7.0.0
chore(deps): bump pytest from 6.2.5 to 7.0.0 in /test/requirements
2022-02-07 09:05:41 +01:00
dc8094daf5 chore(deps): bump pytest from 6.2.5 to 7.0.0 in /test/requirements
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.5 to 7.0.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/6.2.5...7.0.0)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-07 04:23:26 +00:00
dbdf7d70e4 Merge pull request #1875 from nginx-proxy/dependabot/docker/nginx-1.21.6
chore(deps): bump nginx from 1.21.5 to 1.21.6
2022-02-03 12:40:55 +01:00
2671ef4aef chore(deps): bump nginx from 1.21.5 to 1.21.6
Bumps nginx from 1.21.5 to 1.21.6.

---
updated-dependencies:
- dependency-name: nginx
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-26 04:07:38 +00:00
42c8b0c4c9 CI: replace maintainer label w/ OCI authors label 2022-01-14 14:39:33 +01:00
0ff39b804c ci: use git describe for OCI image version label 2022-01-14 14:29:03 +01:00
2daa09ff21 ci: upgrade to docker/metadata-action@v3 2022-01-14 14:17:21 +01:00
b411a84a59 docs: update issue template 2022-01-14 13:38:23 +01:00
54dd5d1ef0 Merge pull request #1865 from nginx-proxy/container-version
Add and display nginx-proxy version
2022-01-13 12:22:08 +01:00
dbca945a8f ci: add nginx-proxy version to image on build 2022-01-12 11:26:20 +01:00
e22ae4a6fd tests: display container version 2022-01-12 10:17:49 +01:00
fbf37456d0 feat: display container version 2022-01-11 22:38:30 +01:00
fde0e809e4 chore: jwilder/docker-gen > nginx-proxy/docker-gen 2022-01-11 19:55:29 +01:00
679c971a19 docs: update maintainers list on license 2022-01-11 19:46:42 +01:00
53ef90a2f6 docs: nginx badge 1.21.4 -> 1.21.5 2022-01-06 17:12:36 +01:00
ed7b17d9d7 Merge pull request #1856 from polarathene/tests/fix-container-networking
tests: Fix pytest container networking issues
2022-01-06 10:32:40 +01:00
6260c0265e Merge pull request #1858 from nginx-proxy/dependabot/pip/test/requirements/requests-2.27.1
chore(deps): bump requests from 2.26.0 to 2.27.1 in /test/requirements
2022-01-06 10:24:17 +01:00
b9ac4b936e chore(deps): bump requests from 2.26.0 to 2.27.1 in /test/requirements
Bumps [requests](https://github.com/psf/requests) from 2.26.0 to 2.27.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.26.0...v2.27.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-01-06 04:21:32 +00:00
780744f231 Merge pull request #1853 from nginx-proxy/dependabot/docker/nginx-1.21.5
chore(deps): bump nginx from 1.21.4 to 1.21.5
2021-12-31 13:58:44 +01:00
6b3ee66783 chore: white-space housekeeping
Noticed some trailing white-space. Removed for consistency with the rest of the file.
2022-01-01 01:39:51 +13:00
115461744b fix: Skip IPv6 when forced but not available + avoid none network
A test on raw IP addresses doesn't reach the existing IPv6 skip logic, added that to avoid a test failing when only IPv4 is available (eg: standard docker container networks).

Additionally some other tests set the `none` network and connecting to this fails as it's not allowed? Preventing that from happening resolves the final failing tests within containerized pytest.
2022-01-01 01:38:13 +13:00
a96135b74d Merge pull request #1848 from polarathene/tests/dhparam-followup
tests: Revise DH param tests
2021-12-31 13:27:50 +01:00
04b0181980 fix: Ensure networks are actually connected to pytest container
The `network` object would never be in a list of network names (strings), and without `greedy=True` arg as the `docker-py` API docs note, the containers will not be part of the results, thus always returning an empty list which was not intended..

Now the network will properly match the current networks for pytest container, avoiding duplicate connect attempts, and the network list result will actually have containers to count when filtering by length.
2021-12-31 22:30:49 +13:00
0e5d97a268 fix: Don't connect pytest container to networks when using host network
This is not compatible or required, since host networking is no longer isolated to container networks only.
2021-12-31 22:14:26 +13:00
b2b4c71997 fix: Don't remove pytest container when running with host network mode
When the container runs with host networking instead of the default bridge, the `$HOSTNAME` / `/etc/hostname` reflects that of the host instead of the container ID , which causes the pytest container to get removed accidentally.

Using a container name instead we can more reliably target the container to avoid removing it, should we need to run with host networking instead.
2021-12-31 22:12:25 +13:00
e748d53a1f chore: Extract hostname access to a var
DRY and clearer that we're referring to the pytest container.
2021-12-31 21:51:40 +13:00
93c04dce8d fix: Properly detect pytest running via container
The original `/.dockerenv` approach is no longer valid, and context wise we're only using this for the test suite, so using an ENV in that container is a better solution.
2021-12-31 21:42:38 +13:00
0493e799f4 chore(deps): bump nginx from 1.21.4 to 1.21.5
Bumps nginx from 1.21.4 to 1.21.5.

---
updated-dependencies:
- dependency-name: nginx
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-30 04:08:35 +00:00
c5166f580e tests: Add utility method to verify TLS chain of trust 2021-12-21 18:44:51 +13:00
9dc9d90d34 tests: Verify site-specific DH params feature works correctly
This addition requires usage of `DEFAULT_HOST` on containers tested to ensure they don't accidentally use `web2` as their default fallback (due to no SNI / `-servername` requested in openssl queries), otherwise they would be testing against the incorrect DH params response.

They could alternatively request an FQDN explicitly as well, instead of relying on implicit fallback/default server selection behaviour.

---

`web2.nginx-proxy.tld.dhparam.pem` is a copy of `ffdhe2048.pem`.
2021-12-21 18:41:43 +13:00
0f15130476 tests: Verify correct DH group size when negotiating
Additionally allows for adding extra openssl params when needed.
2021-12-21 18:41:43 +13:00
75528bdfcb chore: Refactor checksum comparisons
- Use a DRY method instead.
- ENV test changed from 2048-bit to 3072-bit to avoid confusion in a future test that should not be mixed up accidentally with 2048-bit elsewhere.
- Custom DH file test comparison changed to match other comparisons for equality against the expected DH param content.
- Related comments revised, additional comment for context added by the test definition.
- Minor white-space adjustments.
2021-12-21 18:41:43 +13:00
7c02ff637a Merge pull request #1843 from nginx-proxy/nginx-1.21.4
Bump nginx to 1.21.4
2021-12-15 14:02:25 +01:00
496e0f5f27 tests: mark test_deleted_cert as xfail
test_delete_cert_and_restart_reverseproxy still fails intermitently
2021-12-15 13:01:38 +01:00
8c909e7d11 build: nginx 1.21.3 -> 1.21.4 2021-12-15 11:53:37 +01:00
d29a53dc1f Merge pull request #1807 from ucyang/pr/remove-tab
Remove unnecessary tabs
2021-12-11 16:08:30 +01:00
a5eaf29c33 Merge pull request #1819 from HPPinata/main
Clarify grammar in DH-GROUP section
2021-11-05 17:39:39 +01:00
bbdee361f1 Clarify grammar in DH-GROUP section
Since the second option got removed, the "either" makes no sense any more and may lead to confusion about non existent alternatives
2021-11-04 21:45:10 +01:00
0780e636f9 Remove unnecessary tabs 2021-10-23 00:08:32 +09:00
83e3b25c46 Merge pull request #1797 from polarathene/feat/prefer-rfc-7919-dhparams
feat: Use RFC 7919 DH groups + Remove DH generation
2021-10-21 08:35:39 +02:00
36c4ed7632 test: replace test dhparam.pem with ffdhe3072.pem 2021-10-20 21:04:29 +02:00
ab7ac0aadb fix: backward compatibility w/ DHPARAM_GENERATION
Also use true rather than 1 to stay consistent
with other boolean environment variables
2021-10-20 19:15:27 +02:00
02396e3b58 Merge pull request #1791 from nginx-proxy/dependabot/pip/test/requirements/docker-5.0.3
chore(deps): bump docker from 5.0.2 to 5.0.3 in /test/requirements
2021-10-09 19:36:39 +02:00
b1b1b700ea chore(deps): bump docker from 5.0.2 to 5.0.3 in /test/requirements
Bumps [docker](https://github.com/docker/docker-py) from 5.0.2 to 5.0.3.
- [Release notes](https://github.com/docker/docker-py/releases)
- [Commits](https://github.com/docker/docker-py/compare/5.0.2...5.0.3)

---
updated-dependencies:
- dependency-name: docker
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-08 04:27:38 +00:00
42cf18734f Merge pull request #1774 from nginx-proxy/dependabot/docker/nginx-1.21.3
chore(deps): bump nginx from 1.21.1 to 1.21.3
2021-09-30 19:17:25 +02:00
41bd4076c0 chore: DRY up test_dhparam.yml
Use YAML anchors for repeated values providing a single source of truth.

I would use `x-*` convention to store anchors above service containers, but this seems to require a compose config that defines the services (and version?) keys, which this test setup was failing to be compatible with for some reason..
2021-09-29 15:20:08 +13:00
391ca3e3b5 fix(Dockerfile): Remove VOLUME in Dockerfile
Anonymous volumes are discouraged for reliable persistence.

Users should use named volumes or bind mounts instead. Potentially breaking change, users can also use explicit anonymous volumes instead of relying on implicit anonymous volumes.

`nginx-proxy` really should not be creating implicit anonymous volumes as in most cases it is undesirable.

`git blame` reveals this was added in 2014  by jwilder, with a message that implies implicit anonymous volumes was never intended..
2021-09-28 21:59:53 +13:00
0cd573f043 tests(pytest.sh): Update Syntax
- Added clarification comment of the DIR command
- Quoted `ARGS` usage required wrapping `ARGS` assignment in an array to properly expand. This wasn't broken before, but is required change to keep ShellCheck  lint happy.
- Quote wrapped `DIR` usage, the volume target had an extra `/` before the `DIR` which seems unnecessary as `pwd` should return absolute path.
- Expanded `docker run` options to long-form.
2021-09-28 21:59:53 +13:00
e81001615c tests: Improve error handling output and use regular string comparisons
As this project isn't exactly python focused apart from the test suite, I'll assume other contributors are probably not as experienced with python either. Since this is a rather technical test, the extra comments should help grok the functionality without floundering around with the docs.

When the subprocess raises an exception due to an issue with the command (_eg using `-CAfile` arg to `openssl` with an invalid path_), the tests would output large walls of text that wasn't particularly helpful in troubleshooting the issue. `stderr` was also leaking out inbetween the test case results in the terminal, this has been resolved by ensuring that output is caught and piped, which keeps it available to python when an exception is raised. Identifying the actual error cause and location is now much nicer.

Updated the output to be plain string content instead of byte strings, this works fine :)
2021-09-28 21:59:53 +13:00
1d2f308cdf feat: Bring back ability to skip default DH params
Adds back the ability to avoid using DH params, provided no file was explicitly supplied.

This used to be `DHPARAM_GENERATION=false`, the equivalent is now `DHPARAM_SKIP=1` (default 0). Previous name was no longer appropriate.

Ensures that if a user has explicitly provided their own dhparam file to still output a warning instead of the skip message, since `DHPARAM_SKIP=1` doesn't disable the support in nginx.
2021-09-28 21:59:53 +13:00
fd35a09240 tests: Revise dhparams tests
- `dhparam_generation` tests are no longer necessary, dropped.

Modified the remaining `dhparam` test to use multiple `nginx-proxy` images to verify correct behavior for different configs.

Tests now cover:

- Default (ffdhe4096) is used.
- Alternative via ENV (ffdhe2048) works correctly.
- Invalid group via ENV (1024-bit) fails.
- Custom DH params provided via file mount works with warning emitted.

---

- `assert_log_contains`: added a `container_name` arg with `nginxproxy` as the default value. This allows multiple nginx-proxy containers to utilize this method instead.

- Extracted out the `openssl` test (_to `negotiate_cipher()`_) and modified it to be a bit more flexible. It now takes a container with optional extra args to pass to `openssl` command called, as well as the `grep` string to match. This made the original test redundant, so I've dropped it.

- Added two methods to use `negotiate_cipher()`, one verifies a DHE cipher suite was negotiated and checks that a DH emphermal key was also mentioned in the output. The other method verifies the expectation of failing to negotiate a valid cipher if DH params have not been set, while verifying that non-DHE cipher suites can be successfully negotiated.

- Added a `get_env()` method for extracting attached environments on a container. This is useful for verifying invalid `DHPARAM_BITS` values (eg `1024`-bit).

- The original `Server Temp Key` assertion was incorrect, it was expecting a value that is unrelated to DHE cipher suite support (_`X25519` is related to ECDHE_). This is due to TLS 1.3 being negotiated where you cannot use custom DH params, nor influence the negotiated cipher due to this mechanism changing from TLS 1.3. TLS 1.3 does support DH params, but it internally negotiates RFC 7919 group between server and client instead. Thus to verify expectations, the connection via `openssl` is made explicitly with TLS 1.2 instead.
2021-09-28 21:59:53 +13:00
9299a2801e tests: Remove dhparam volume
No longer necessary for the majority of tests.
2021-09-28 21:50:11 +13:00
004e4a5cda chore: Refactor _setup_dh()
- `DHPARAM_FILE` is a local var not intended for overriding via ENV. Clarified that with `local` declaration.

- `FFDHE_GROUP` var uses default assignment (_`:=4096` instead of only substitute `:-4096`_), so that `DHPARAM_BITS` retains the default 4096 value in subsequent references if no custom size was provided.

- Refactored the conditional statements to only handle early failure conditions. Shifting out the RFC7919 support that can run after all checks have passed.

- Revised comments.
2021-09-28 21:50:11 +13:00
a7a2d6e44b chore: Use direct URL instead of URL shortener
Implicit URL is unnecessary (_and presently relies on Github redirecting from it's original mapped URL_).

Use an explicit URL instead to reduce the guesswork/trust of where the shortener was going to redirect to.
2021-09-28 21:50:11 +13:00
6f7eb8bd97 chore: 6/6 - Update shell syntax
- `==` for string equality since we're using bash `[[ test ]]` already.
- Uppercase `socket_file` variable to be consistent with other internal variables used in the script.
- Convert `[ test ]` to `[[ test ]]` for consistency, improving maintenance. Double-bracket (_not posix compatible_) does not require quoted variables, ShellCheck lint knows this is safe too :)
- `-z` test for `$RESOLVERS` is native syntax to check for empty string value.
- Referenced variables should generally be wrapped like so `"${VAR}"`.
- Variable assignments with string values should be double quotes for content with variables, otherwise use single quotes (_no interpolation_).
- Converted my if statements to use the same style used in the rest of the file.
2021-09-28 21:50:11 +13:00
0f330b85b1 chore: 5/6 - Shift dhparam method to the bottom
Minor change on error message.
2021-09-28 21:50:11 +13:00
ed009c0ec8 chore: 4/6 - Extract grouped logic to their own methods 2021-09-28 21:50:11 +13:00
091dd855af chore: 3/6 - Indent function content
This is a white-space only change to ease review diff noise.
2021-09-28 21:50:11 +13:00
2e6d7561a3 chore: 2/6 - Handle CMD check early, wrap init logic into a function 2021-09-28 21:50:11 +13:00
8aacd13241 chore: 1/6 - Inline failure at it's cause
This change has been split into 6 iterative parts/commits to ease the review process.
2021-09-28 21:50:11 +13:00
ac066a73e4 feat: Replace generated DH params with RFC 7919 standardized DHE groups
- While the anonymous VOLUME can be dropped from Dockerfile, the path needs to be valid at run-time, might as well ensure it's available by creating the dhparam folder at build.

- Generation logic no longer necessary, dropped. 

- Standardized RFC 7919 groups added (2048, 3072, 4096), with 4096-bit remaining the default size. The DH logic can live in the entrypoint script as well. 

- Third-party supplied pre-generated DH params removed as they're not considered trustworthy compared to RFC 7919 groups.
2021-09-28 21:30:02 +13:00
b133403331 Merge pull request #1775 from kevinnls/patch-1
fix link
2021-09-10 16:19:02 +02:00
dc9876b6c2 fix anchor 2021-09-10 19:27:33 +05:30
583c71ec3d chore(deps): bump nginx from 1.21.1 to 1.21.3
Bumps nginx from 1.21.1 to 1.21.3.

---
updated-dependencies:
- dependency-name: nginx
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-10 04:12:34 +00:00
07abbb4c0d Merge pull request #1770 from crazy-max/path-context
Use path context
2021-09-08 16:05:20 +02:00
7b489159b3 Use path context 2021-09-08 14:25:56 +02:00
e166a93a56 Merge pull request #1764 from nginx-proxy/dependabot/pip/test/requirements/docker-5.0.2
chore(deps): bump docker from 5.0.0 to 5.0.2 in /test/requirements
2021-09-08 12:18:40 +02:00
083d86a79d chore(deps): bump docker from 5.0.0 to 5.0.2 in /test/requirements
Bumps [docker](https://github.com/docker/docker-py) from 5.0.0 to 5.0.2.
- [Release notes](https://github.com/docker/docker-py/releases)
- [Commits](https://github.com/docker/docker-py/compare/5.0.0...5.0.2)

---
updated-dependencies:
- dependency-name: docker
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-02 04:18:54 +00:00
481c5a2318 Merge pull request #1760 from nginx-proxy/python-docker-mod-check
Ease version check on python docker module for tests
2021-09-01 14:48:35 +02:00
a1ff28cec8 CI: ease version check on python docker module 2021-09-01 09:31:02 +02:00
86c194e181 CI: disable fail-fast 2021-09-01 09:16:14 +02:00
52d208daf3 Merge pull request #1756 from nginx-proxy/dependabot/pip/test/requirements/pytest-6.2.5
chore(deps): bump pytest from 6.2.4 to 6.2.5 in /test/requirements
2021-09-01 08:59:38 +02:00
308df38b14 chore(deps): bump pytest from 6.2.4 to 6.2.5 in /test/requirements
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.4 to 6.2.5.
- [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/6.2.4...6.2.5)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-31 04:22:47 +00:00
7bb3fd56c6 Merge pull request #1753 from mnahinkhan/patch-1
Update README.md
2021-08-30 11:14:37 +02:00
7dfee13b56 Update README.md 2021-08-30 06:44:52 +03:00
8adbea8aec Merge pull request #1736 from nginx-proxy/predictable-upstream
Revert to predictable upstream names, optional SHA1 names
2021-08-19 12:36:13 +02:00
a33af34361 docs: predictable vs SHA1 upstream names 2021-08-19 11:41:30 +02:00
e748ffdce4 feat: sha1 upstream names 2021-08-17 21:51:09 +02:00
d10531e925 tests: predictable upstream names 2021-08-17 21:50:18 +02:00
ded3cfc168 docs: don't prefix copy pastable commands with $
+ other small markdown fixes
2021-08-17 11:29:21 +02:00
eb3bb2ab07 docs: fix line feeds 2021-08-17 11:13:31 +02:00
0e3844ad1e Merge pull request #1725 from nginx-proxy/fix-1693
Use sha1 of hostname as upstream names
2021-08-11 17:54:29 +02:00
b6bd9e24a8 Merge pull request #1726 from nginx-proxy/dependabot/docker/golang-1.16.7
chore(deps): bump golang from 1.16.6 to 1.16.7
2021-08-08 14:10:10 +02:00
c36633320e chore(deps): bump golang from 1.16.6 to 1.16.7
Bumps golang from 1.16.6 to 1.16.7.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-06 04:11:55 +00:00
89d37882b6 fix: always use sha1 of hostname as upstream name 2021-08-04 22:28:00 +02:00
ba86bc04f6 tests: check for raw IPv4/6 used as VIRTUAL_HOST 2021-08-04 22:25:55 +02:00
39a59e6168 Merge pull request #1724 from nginx-proxy/dockergen-0.7.7
Bump docker-gen from 0.7.6 to 0.7.7
2021-08-04 10:34:55 +02:00
8526d918ed style: Dockerfiles linting 2021-08-04 08:49:23 +02:00
897e4135d3 build: docker-gen 0.7.6 -> 0.7.7 2021-08-04 08:48:25 +02:00
df638c3fe6 ci: cleanup left over volumes after tests 2021-08-02 19:31:36 +02:00
10a4db5067 ci: remove xfail from tests that were fixed 2021-08-02 19:08:06 +02:00
d3fc5c506a ci: enable Docker IPv6 on tests that require it 2021-08-02 18:37:33 +02:00
795e0acda7 ci: remove InsecureRequestWarning from urllib3 2021-08-02 18:09:34 +02:00
caab609f5d Merge pull request #1723 from nginx-proxy/ci-pip-docker
Update docker and docker-compose pip packages
2021-08-02 15:11:44 +02:00
90a7218622 ci: update contest.py 2021-08-02 14:48:40 +02:00
ce4ce0676a ci: update docker and docker-compose pip packages 2021-08-02 14:44:21 +02:00
6988797759 Merge pull request #1720 from nginx-proxy/dependabot/pip/test/requirements/pytest-6.2.4
chore(deps): bump pytest from 6.2.2 to 6.2.4 in /test/requirements
2021-08-02 14:36:04 +02:00
1ba594cc4d chore(deps): bump pytest from 6.2.2 to 6.2.4 in /test/requirements
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.2 to 6.2.4.
- [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/6.2.2...6.2.4)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-02 11:05:37 +00:00
54f66dc67a Merge pull request #1721 from nginx-proxy/dependabot/pip/test/requirements/backoff-1.11.1
chore(deps): bump backoff from 1.10.0 to 1.11.1 in /test/requirements
2021-08-02 13:04:51 +02:00
9855571616 chore(deps): bump backoff from 1.10.0 to 1.11.1 in /test/requirements
Bumps [backoff](https://github.com/litl/backoff) from 1.10.0 to 1.11.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.10.0...v1.11.1)

---
updated-dependencies:
- dependency-name: backoff
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-02 10:55:56 +00:00
16b21a3af8 Merge pull request #1718 from nginx-proxy/dependabot/pip/test/requirements/requests-2.26.0
chore(deps): bump requests from 2.25.1 to 2.26.0 in /test/requirements
2021-08-02 12:55:16 +02:00
eefea9daec chore(deps): bump requests from 2.25.1 to 2.26.0 in /test/requirements
Bumps [requests](https://github.com/psf/requests) from 2.25.1 to 2.26.0.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.25.1...v2.26.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-02 10:47:08 +00:00
b01d6dd9cc ci: enable Dependabot checks for Python 2021-08-02 12:46:45 +02:00
4e3e518936 docs: update issue template w/ link to discussions 2021-07-19 21:24:28 +02:00
607f481d44 Merge pull request #1697 from nginx-proxy/dependabot/docker/golang-1.16.6
chore(deps): bump golang from 1.16.5 to 1.16.6
2021-07-15 07:57:17 +02:00
0b735897cb chore(deps): bump golang from 1.16.5 to 1.16.6
Bumps golang from 1.16.5 to 1.16.6.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-15 04:11:52 +00:00
785141c7a0 docs: update nginx version badge to 1.21.1 (typo) 2021-07-09 08:13:06 +02:00
d61f25ed3e docs: update nginx version badge to 1.21.1 2021-07-09 08:12:06 +02:00
6889b3a25a Merge pull request #1686 from nginx-proxy/dependabot/docker/nginx-1.21.1
chore(deps): bump nginx from 1.21.0 to 1.21.1
2021-07-09 08:09:54 +02:00
d743160597 chore(deps): bump nginx from 1.21.0 to 1.21.1
Bumps nginx from 1.21.0 to 1.21.1.

---
updated-dependencies:
- dependency-name: nginx
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-09 04:11:58 +00:00
323837bf70 Merge pull request #1679 from pini-gh/pini-1609
Add test and fix `server 127.0.0.1 down` fallback for load balancing use case
2021-07-03 23:48:09 +02:00
dfc84558a5 fix: upstream fallback entry with load balancing 2021-06-21 00:48:21 +02:00
a637b399b8 test: add test_server-down/test_load-balancing
Check that when multiple containers have the same WIRTUAL_HOST and one of
them is unreachable, the resulting `upstream` block has no
`server 127.0.0.1 down;` entry.
2021-06-21 00:48:21 +02:00
2006968c05 Merge pull request #1667 from pini-gh/pini-1609
Use `server 127.0.0.1 down` entry only when required
2021-06-20 18:04:19 +02:00
54347a9787 docs: precision about ports in VIRTUAL_HOST 2021-06-20 17:51:09 +02:00
f9e58cea9b ci: allow tests to be manually triggered 2021-06-16 01:39:47 +02:00
7c0a4cb0b3 fix: escape backslash in test 2021-06-15 23:55:31 +02:00
fca248a965 fix: server 127.0.0.1 down entry only when required 2021-06-15 23:54:24 +02:00
98fe68432a ci: update Dependabot labels 2021-06-15 23:32:38 +02:00
84ae835582 docs: fix markdown link error 2021-06-15 00:51:00 +02:00
ef2bdb5304 Merge pull request #1662 from nginx-proxy/http-https-port-doc-tests
Docs, fix and tests for custom HTTP/HTTPS ports
2021-06-15 00:46:28 +02:00
790785f1ab test: custom HTTPS port and redirection 2021-06-15 00:38:32 +02:00
fa8b0d7bad fix: HTTPS redirection with custom HTTPS port 2021-06-15 00:33:06 +02:00
6bb7c37605 test: custom HTTP port 2021-06-15 00:13:06 +02:00
d1cf6b57d7 docs: custom external HTTP/HTTPS ports 2021-06-15 00:00:50 +02:00
b9e301d769 docs: update nginx version badge 2021-06-14 15:17:23 +02:00
987c996173 Merge pull request #1641 from nginx-proxy/dependabot/docker/nginx-1.21.0
chore(deps): bump nginx from 1.19.10 to 1.21.0
2021-06-14 13:47:26 +02:00
eb00b066de Merge pull request #1659 from exussum12/patch-1
Improve logging
2021-06-14 11:42:19 +02:00
e9ab13781d Fix spacing 2021-06-09 20:51:51 +01:00
9f069a42ac Improve logging
Currently its almost impossible to know which host actually handled the request, this extra variable logs the upstream server too
2021-06-09 20:51:08 +01:00
d9d7a3354d Merge pull request #1653 from nginx-proxy/dependabot/docker/golang-1.16.5
chore(deps): bump golang from 1.15.10 to 1.16.5
2021-06-09 01:34:47 +02:00
1967ca2a57 chore(deps): bump golang from 1.15.10 to 1.16.5
Bumps golang from 1.15.10 to 1.16.5.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-08 23:28:24 +00:00
ae5623916b chore(deps): bump nginx from 1.19.10 to 1.21.0
Bumps nginx from 1.19.10 to 1.21.0.

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-08 23:28:15 +00:00
7f2307626d Merge pull request #1603 from nginx-proxy/forego
Chore: switch to go mod compatible fork of forego
2021-06-09 01:27:31 +02:00
242caf9e69 chore: switch to go mod compatible fork of forego 2021-06-09 01:18:02 +02:00
49b2b5cd97 Merge pull request #1609 from pini-gh/pini-1132
Honor VIRTUAL_PORT + DEBUG flag + fallback entry
2021-05-28 12:07:32 +02:00
2bb53bd303 test: add tests for the DEBUG flag 2021-05-28 01:52:01 +02:00
3785649eb6 test: VIRTUAL_PORT != single exposed port 2021-05-28 00:04:59 +02:00
97a5dec57a Honor VIRTUAL_PORT + DEBUG flag + fallback entry
The VIRTUAL_PORT environment variable should always be honored.
Even when the related port is not exposed.
Fix for nging-proxy/nginx-proxy#1132.

This commit also add the DEBUG environment variable which enables more
verbose comments in the nginx comfiguration file to help troubleshooting
unreachable containers.

Finaly it fixes nging-proxy/nginx-proxy#1105 as well by defining only one
fallback entry per upstream block.
2021-05-28 00:04:43 +02:00
3afdd9d9e3 Merge pull request #1620 from alekna/server_tokens
Make server_tokens configurable per virtual-host
2021-05-13 22:58:12 +02:00
fb7a11212f Make server_tokens configurable per virtual-host 2021-05-13 21:52:06 +01:00
5bcb77c240 Merge pull request #1619 from alekna/create_server_certificate
Fix broken create_server_certificate.sh
2021-05-11 12:13:36 +02:00
70b95b1708 Fix create_server_certificate.sh
Docker image nginx:1.14.1 has no openssl installed. Therefore upgrading to nginx:1.19.10
2021-05-11 10:29:22 +01:00
e3e8d24930 Merge pull request #1185 from kressh/master
Set proper X-Forwarded-Ssl for SSL-terminated setups
2021-05-05 16:32:47 +02:00
09d30cf1a6 ci: don't run tests on docs only change 2021-05-01 22:37:01 +02:00
a9cfdc843e docs: fix broken link 2021-05-01 22:30:57 +02:00
fa3962e54f Merge pull request #1557 from joe-p/remove_scoped
Remove scoped IPv6 addresses from resolvers (fix #1424)
2021-04-29 22:50:04 +02:00
65a88a0291 Merge branch 'main' into remove_scoped 2021-04-29 22:36:01 +02:00
b1d5967d9c Merge pull request #1263 from jessejoe/improve_skipping_dhparam
Change dhparam positional args to be inherited vars, standardize naming
2021-04-29 03:33:49 +02:00
ab81ff8df2 style: linting with shellcheck 2021-04-29 03:18:40 +02:00
c327496495 refactor: do not pass unused positional arguments 2021-04-29 03:18:04 +02:00
cbc6f09d2a Change dhparam positional args to be inherited vars, standardize naming
PR #913 added `DHPARAM_GENERATION` as a positional argument to
generate-dhparam.sh. However, since it was the second positional argument,
`DHPARAM_BITS` would also have to be defined or `DHPARAM_GENERATION` would be
read into `DHPARAM_BITS`. This changes the arguments to be inherited variables
which do not depend on order, just declaration.

Also change instances of `GENERATE_DHPARAM` to `DHPARAM_GENERATION` since it's
unnecessary to have another variable. I think `GENERATE_DHPARAM` is actually a
better name (verb vs. noun), but `DHPARAM_GENERATION` is already defined and
may break someone if changed.

Addresses https://github.com/jwilder/nginx-proxy/pull/913#issuecomment-476014691
2021-04-29 03:11:43 +02:00
5c1a1c8a6d Merge pull request #1163 from cheald/unique-upstreams
Suffix upstream names to prevent confusion with FQDNs
2021-04-29 02:30:45 +02:00
85327a871e Suffix upstream names to prevent confusion with FQDNs 2021-04-29 02:21:19 +02:00
e3cc439ff0 doc: bring badges in line with acme-companion 2021-04-28 22:43:40 +02:00
35df872705 Merge pull request #973 from Sparted/master
Upd: Boost worker_connections from 1024 to 10240.
2021-04-28 21:39:57 +02:00
1f937dd6a5 docs: don't mention Docker container based tests
Those aren't working yet and are being worked on
close #1605
2021-04-28 09:58:03 +02:00
f7444094ca ci: remove Travis CI 2021-04-27 01:12:28 +02:00
0d2efaee95 docs: update nginx version and CI badge 2021-04-27 01:10:17 +02:00
a6f4bfa15b Merge pull request #1590 from nginx-proxy/dependabot/docker/nginx-1.19.10 2021-04-26 22:50:19 +00:00
5e4f005240 Bump nginx from 1.19.3 to 1.19.10
Bumps nginx from 1.19.3 to 1.19.10.

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-26 22:44:46 +00:00
aa9386129d Merge pull request #1572 from kmarilleau/travis_to_github_actions
Travis to GitHub actions
2021-04-27 00:42:21 +02:00
1518c39e1b docs: update "how to install/test" parts 2021-04-27 00:35:21 +02:00
39f822dd8b refactor(ci): ♻️ refactor makefile and modify its usage on CI 2021-04-27 00:35:21 +02:00
1591fd7968 chore(ci): 💚 use standard python for nginx-proxy-tester 2021-04-27 00:35:21 +02:00
3b1163291b fix(test): test_dockergen_v3 version comparison 2021-04-27 00:35:21 +02:00
dd853b2572 chore(ci): 👷 mv unit test from travis to ga 2021-04-27 00:35:20 +02:00
dd7f7e8427 fix(ci): wrong nginx-proxy image used on default_host test 2021-04-27 00:35:20 +02:00
0c60d57031 fix(ci): fix test_dhparam_is_generated_if_missing 2021-04-27 00:35:20 +02:00
6fd3cfb38f fix(ci): 🔧 add markers on pytest.ini to fix warnings 2021-04-27 00:35:20 +02:00
37e85e6e8d chore(ci): ♻️ convert Python old % string to f-strings 2021-04-27 00:35:20 +02:00
eba9ac4261 chore(ci): ⬆️ update python dependencies to latests release 2021-04-27 00:35:19 +02:00
950a28f5ea chore(ci): ⬆️ porting python 2.7 code to python 3.9 2021-04-27 00:35:19 +02:00
fe79dd4cd3 Merge pull request #1601 from nginx-proxy/dockergen-0.7.6
Bump docker-gen from 0.7.4 to 0.7.6
2021-04-26 15:09:55 +02:00
f8aa9a1637 chore: bump docker-gen from 0.7.4 to 0.7.6 2021-04-26 14:55:33 +02:00
eac17ac03c Merge pull request #1599 from tkw1536/patch-1
Remove Google Forum Link from Issue Template
2021-04-21 23:45:32 +02:00
cfa9cf31d7 Remove Google Forum Link from Issue Template
The Google Forum no longer exists. Therefore the link to it in the issue template should be removed.
2021-04-21 21:04:45 +02:00
6613e272eb ci: rebuild and push the latest image on schedule
Rebuild and push the last commit of the default branch every monday at 00:00 UTC
2021-04-07 17:10:37 +02:00
9efeb5d8af ci: build the debian and alpine images in parallel 2021-04-06 00:11:53 +02:00
24565440b2 docs: update DockerHub shields 2021-04-05 13:56:14 +02:00
bdf62b025b docs: follow acme-companion name change 2021-04-05 13:16:40 +02:00
c3bb234871 chore: rename default branch master -> main 2021-04-05 13:13:20 +02:00
6e17d6ff7b Merge pull request #1505 from ecerutti/patch-1
Update README.md
2021-04-05 09:57:53 +02:00
2b32f44454 Merge pull request #1145 from kfkonrad/master
Clarify default host usage
2021-04-05 09:50:34 +02:00
0f427dd32d Merge pull request #1184 from kylegoetz/master
Update README.md - sample yml needed expose option
2021-04-05 09:46:40 +02:00
21caa570fb Merge pull request #1332 from ArgonQQ/patch-1
Will fix spelling
2021-04-05 09:31:18 +02:00
fcfe17a0a4 Merge pull request #1538 from S0obi/patch-1
Update docker-entrypoint.sh comment on DHPARAM default key size
2021-04-02 01:49:36 +02:00
d120ce9fde ci: push images to jwilder/nginx-proxy 2021-04-02 00:39:41 +02:00
4a1d5bfc58 ci: build and push for arm64 and arm/v7 archs 2021-04-01 22:23:37 +02:00
bea149e317 ci: create dependabot config for Docker ecosystem 2021-04-01 21:06:33 +02:00
65b44f0ca2 Merge pull request #1470 from KWARC/build-from-scratch
Enable multi-architecture docker image builds
2021-04-01 19:08:23 +02:00
ad7c02570b chore: use nginxproxy's DockerHub registry
Transitioning away from jwilder/nginx-proxy
Please see #1304 for more details
2021-04-01 16:06:09 +02:00
83ca0511d1 Hardcode nginx 1.19.3 for use in Docker Images
This commit updates both 'Dockerfile' and 'Dockerfile.alpine' to use
'nginx 1.19.3'. This change was implemented after feedback from @buchdag
to be able to use dependabot.
2021-04-01 15:54:26 +02:00
6b8cd894da Hardcode go 1.15.10 for use in Docker Images
This commit updates both 'Dockerfile' and 'Dockerfile.alpine' to use
'go.15.10' when building the dependencies. This change was implemented
after feedback from @buchdag to be able to use dependabot.
2021-04-01 13:54:37 +02:00
3a8b49f153 ci: build and push to DockerHub w/ GitHub Actions 2021-04-01 12:14:32 +02:00
886dd04b62 Enable multi-architecture docker image builds
Previously, the Dockerfile downloaded 'docker-gen' and 'forego' binaries
during build time. This caused a problem as it hard-coded the amd64
architecture for the images.

This commit updates both 'Dockerfile' and 'Dockerfile.alpine' to build
the `forego` and `docker-gen` executables from scratch instead of
downloading binaries directly.

This is achieved using multi-stage builds [1]. Two seperate stages first
build the binaries, and are then copied over to the final stage.

The advantage of this change is two-fold: First, it enables building
this image on architectures other than amd64. Secondly it adds trust by
not adding external binaries to the docker image.

This modified version passes the test both a linux desktop (amd64) as
well as a raspberry pi (armv7) with some caveats:

- On armv7, a modified version of the `jwilder/docker-gen` image is
required. See a seperate PR at [2].

- The 'test_dhparam_is_generated_if_missing' test fails. This also
doesn't currently pass on master.

[1] https://docs.docker.com/develop/develop-images/multistage-build/ [2]
https://github.com/jwilder/docker-gen/pull/327
2021-03-21 12:31:06 +01:00
bf2d7295d3 Merge pull request #1409 from nginx-proxy/no-https-redirect-acme
Bring ACME no redirection inline with companion
2021-03-17 20:31:37 +01:00
1a0d0d822e update IPv6 section in README 2021-02-06 18:56:30 +00:00
2bde43c6e9 remove scoped ipv6 resolvers 2021-02-05 19:56:56 +00:00
8d0ab90536 Update README for DHParam default size 2020-12-06 19:09:55 +01:00
aba100ff7b Update docker-entrypoint.sh
Default key size is not 2048 anymore but 4096, reference : https://github.com/nginx-proxy/nginx-proxy/blob/master/generate-dhparam.sh#L4
2020-12-02 13:18:32 +01:00
c8a6785898 Update version to 0.8.0 2020-10-30 10:19:56 -06:00
20cc3527b4 Merge pull request #1508 from lemker/master
Upgrade Nginx to 1.19.3
2020-10-08 20:17:32 -06:00
ea28f2f32f Upgrade Nginx to 1.19.3 2020-10-08 19:05:47 -07:00
5c252001a5 Update README.md 2020-10-03 21:08:12 -03:00
b0c6c9f67e Merge pull request #1386 from juliushaertl/enh/hsts-https-method-fallback
Add fallback to the proxy containers env for HTTPS_METHOD and HSTS
2020-06-29 11:38:05 -06:00
5b469894d4 Merge pull request #1432 from KetchupBomb/update_readme
Fix docker-gen Docker Hub URL
2020-06-29 11:36:18 -06:00
d3ff74e48a Merge pull request #1452 from benchonaut/patch-1
update key length  , speed up dhparam generation
2020-06-29 11:34:13 -06:00
be107963a7 update key length , speed up dhparam generation 2020-06-15 04:22:58 +02:00
e8b68e5f41 Fix docker-gen Docker Hub URL 2020-05-08 19:09:42 -07:00
3cbc5417b7 Merge pull request #1113 from basro/master
Set DISABLE_ACCESS_LOGS env var to disable access logs
2020-03-25 14:27:02 -06:00
8219788df6 Merge branch 'master' into master 2020-03-25 14:26:30 -06:00
944163d70d Bring ACME no redirection inline with companion
Add the following to the Let's Encrypt ACME challenge "no redirection to HTTPS"
https://github.com/nginx-proxy/docker-letsencrypt-nginx-proxy-companion/pull/570
https://github.com/nginx-proxy/docker-letsencrypt-nginx-proxy-companion/pull/335
2020-03-20 22:28:15 +01:00
941fd630a6 Merge pull request #1069 from ivoputzer/patch-1
Fixes typo
2020-03-03 00:29:54 -05:00
b4709639b3 Merge pull request #1353 from nanawel/feature/custom-external-ports-support
Add support for custom external HTTP/HTTPS ports
2020-03-03 00:24:21 -05:00
b8141832a3 Merge pull request #1336 from cherouvim/patch-1
typo
2020-02-29 23:11:12 -05:00
0223bae0af Merge pull request #1402 from sgabe/upgrade-nginx
Upgrade to 1.17.8
2020-02-29 23:09:59 -05:00
6798a6b800 Upgrade to 1.17.8 2020-02-28 16:36:36 +01:00
4a2dc46002 Merge pull request #1198 from umevoshi/master
Add gRPC protocol support (#1345)
2020-02-11 11:45:53 -07:00
718d45feaf Merge pull request #1338 from mauvm/patch-1
Do not HTTPS redirect Let'sEncrypt ACME challenge
2020-02-09 13:31:42 -07:00
0dfe09fb7c Merge pull request #1366 from jakejarvis/nginx-1.17.6
Upgrade nginx to 1.17.6
2020-02-09 13:30:06 -07:00
f8b4553eee Add fallback to the proxy containers env for HTTPS_METHOD and HSTS
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-01-30 08:24:38 +01:00
77227f8691 Upgrade nginx to 1.17.6 2019-12-04 10:19:17 -05:00
e762468759 Merge pull request #1356 from matt-hh/upgrade-nginx-1.17.5
Upgrade to 1.17.5
2019-11-08 07:00:06 -07:00
cf911d950a Upgrade to 1.17.5
closes #1337, resolves #1355
2019-11-08 14:11:17 +01:00
a3e64a9433 Add support for custom external HTTP/HTTPS ports (see https://groups.google.com/forum/#!topic/nginx-proxy/0I2jevmgTLI) 2019-11-03 14:48:16 +01:00
11d644d645 Do not HTTPS redirect Let'sEncrypt ACME challenge
The auto renewal of Let'sEncrypt certificates fails due to the HTTPS redirect of the ACME challenge.

This workaround resolves the issue:
https://gist.github.com/codekitchen/2c519eb7572002afab6a5f979cd42913#file-letsencrypt-diff

Found through this comment:
https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion/issues/526#issuecomment-476253642
2019-10-01 16:00:41 +02:00
4443ee8b5a Merge pull request #1116 from qiqizjl/master
fix fastcgi bug
2019-09-26 13:21:12 -06:00
08b953ba70 Merge pull request #1252 from jpomykala/patch-1
Update README.md
2019-09-25 19:44:56 -06:00
94f5763c04 Merge pull request #1323 from came88/banner
README.md: fix version in nginx banner
2019-09-25 19:39:17 -06:00
8cf9ed7145 Merge pull request #1328 from dnmvisser/patch-1
Typo
2019-09-25 19:37:42 -06:00
3ce7d99aea typo 2019-09-25 13:21:33 +03:00
45690ee044 Will fix spelling
Just read the documentation and found this spelling issue.
2019-09-19 07:55:43 +02:00
3a9de2d511 Merge pull request #1322 from came88/ssl-configuration
Update ssl configuration
2019-09-09 09:04:20 -06:00
eba7d8af77 Fix comment about Mozilla Modern Policy and TLS1.3
Thanks to @deAtog for pointing it out
2019-09-09 12:45:20 +02:00
d8c04f666f Typo 2019-09-09 07:22:58 +02:00
ede9f9ec25 README.md: fix version in nginx banner 2019-08-29 22:59:43 +02:00
26e764950f Update ssl configuration 2019-08-29 22:14:14 +02:00
b886c0bd14 Merge pull request #1318 from came88/nginx
Upgrade nginx to 1.17.3
2019-08-18 09:13:33 -06:00
a4cc268628 Use nginx 1.17.3 2019-08-18 11:20:05 +02:00
eb3613695c Merge pull request #1313 from JIAZHEN/master
Upgrade nginx to 1.17
2019-08-08 08:26:11 -06:00
23823c4b21 Fix the test 2019-08-07 17:33:02 +01:00
16169a0f74 Use nginx latest version 2019-08-07 17:32:52 +01:00
afa2dc53c7 Update README.md 2019-03-23 12:23:12 +01:00
8c590fc68f Merge pull request #913 from panteparak/DH-Param-Generator-Option
Add DH param generator option
2019-03-05 12:46:49 -07:00
15d2817384 Merge pull request #1230 from kamermans/bugfix/ssl_tests_fail_dhparam
Fixed tests that are now failing due to the dhparam clearing command …
2019-02-05 13:44:45 -07:00
53a396f406 Merge pull request #1213 from seroron/fix_empty_dhparam
Fix empty dhparam.pem
2019-02-05 13:44:02 -07:00
ad41178036 Fixed tests that are now failing due to the dhparam clearing command beating the nginx startup. This is fixed permanently in #1213, but this PR fixes the test so as not to rely on the dhparam autogen, which is tested elsewhere. 2019-02-04 15:15:04 -05:00
7dd97d4bc3 Merge pull request #1111 from kamermans/bugfix/cant-disable-hsts-noredirect
Fixed #1080, can't disable HSTS with noredirect
2019-01-29 16:21:30 -07:00
6a1a518fec Fix empty dhparam.pem 2018-12-18 14:05:17 +00:00
62d51562b5 Add gRPC protocol support 2018-11-15 01:02:57 +09:00
c33dedf10b Merge pull request #1193 from gpkfr/master
Upgrade to nginx 1.14.1 stable version
2018-11-09 09:50:28 -07:00
58c1fe3606 Upgrade to nginx 1.14.1 stable version 2018-11-09 15:26:01 +01:00
330d2cdc0e Set proper X-Forwarded-Ssl for SSL-terminated setups 2018-10-24 19:10:24 +03:00
e014065d9e Update README.md - sample yml needed expose option
Example docker-compose.yml does not work without defining an exposed port for whoami service.
2018-10-24 09:50:28 -05:00
e80fc0b304 Merge pull request #1140 from matt-hh/feature/upgrade-1.14
Upgrade to nginx 1.14 stable version
2018-08-17 10:20:50 -06:00
936e57a6de Fixed #1080, can't disable HSTS with noredirect 2018-08-01 11:30:06 -04:00
07f4c66ee9 clarify default host usage 2018-06-22 19:48:53 +02:00
a285717657 Merge pull request #1123 from kamermans/feature/tls1.3
Add TLSv1.3 support
2018-06-07 15:56:19 -06:00
cb2b0e2bd3 Upgrade to nginx 1.14 stable 2018-06-06 00:56:47 +02:00
4e6900e872 Added TLSv1.3 support 2018-04-22 18:29:35 -04:00
9521593cbc Merge pull request #1124 from kamermans/bugfix/travis-ci-errors-fix2
Bugfix: Test reads from out-of-scope var
2018-04-22 15:47:42 -06:00
af266c0b83 Remove old docker.list to avoid getting unstable Docker version 2018-04-22 16:43:00 -04:00
9be2624d09 Increased dependency versions to get around pip internal problem 2018-04-22 16:11:32 -04:00
c417813df9 Fixed out-of-scope variable 2018-04-22 16:03:43 -04:00
59aa78a4a6 fix fastcgi bug 2018-04-17 21:52:58 +08:00
ccbbbeb928 Merge pull request #1073 from b1f6c1c4/b1f6c1c4-patch-1
Add HSTS header regardless of status code
2018-03-30 17:34:02 -04:00
1c7ccc473f fix fastcgi bug 2018-03-30 09:47:57 +08:00
556b3364fb Merge pull request #1115 from kamermans/docs/ocsp-stapling-info
Added docs on enabling OCSP Stapling
2018-03-28 20:50:15 -04:00
d7e939dc27 Added info on enabling OCSP Stapling 2018-03-28 11:43:41 -04:00
f68383add9 Set DISABLE_ACCESS_LOGS to disable access logs 2018-03-27 21:18:45 -03:00
d8777c8689 Merge pull request #2 from kamermans/b1f6c1c4-patch-1
Add tests to HSTS bugfix
2018-03-27 11:15:12 +08:00
3590c1bae0 Added regression test to ensure HSTS works for errors 2018-03-26 14:58:06 -04:00
c1ae91364c Added endpoint to allow testing alternate response codes 2018-03-26 14:57:50 -04:00
71225a28fa Merge pull request #1026 from jwilder/updates
Updates for 0.7.0 release
2018-03-23 23:34:31 -06:00
f8cd4483ac Update version to 0.7.0 2018-03-23 23:03:42 -06:00
5266553e1b Add issue template/q&a links 2018-03-23 21:07:43 -06:00
1f19ee3c56 Merge pull request #1088 from matt-hh/fix-1076
Enable NETWORK_ACCESS feature for alpine version
2018-03-23 14:54:52 -06:00
6290f38069 Merge pull request #1106 from hwellmann/master
do not create an empty upstream entry for invisible containers
2018-03-23 12:14:37 -06:00
1dce981707 Merge pull request #984 from sydoveton/master
OCSP Stapling was not working
2018-03-23 08:57:27 -06:00
b61c841929 do not create an empty upstream entry for a container from an invisible Docker network 2018-03-22 10:56:41 +01:00
000a44772d Merge pull request #1090 from sergeifilippov/patch-1
Grammar Police
2018-03-08 15:01:00 -07:00
37714fa4f8 Grammar Police
Tiny grammatical fix.
2018-03-09 10:48:14 +13:00
2f8ebe8d45 Enable NETWORK_ACCESS feature for alpine version
This PR fixes a missing line in the alpine version.

- Fixes #1076
- See #842
2018-03-07 22:36:05 +01:00
d6042d08f1 Merge pull request #734 from thomasleveil/knwon_issues
TESTS: add tests for known issues
2018-02-20 14:50:11 -07:00
7a769a6a22 Add HSTS header regardless of status code
See nginx [doc](http://nginx.org/en/docs/http/ngx_http_headers_module.html#add_header) and [blog](https://www.nginx.com/blog/http-strict-transport-security-hsts-and-nginx/).
2018-02-20 17:59:52 +08:00
0f27ed800c fixes typo
spotted a typo within the readme ;) cheers
2018-02-14 21:14:25 +01:00
4932ef3036 Upd: Boost worker_connections from 1024 to 10240. 2018-02-07 15:30:26 +01:00
226bfe158f Merge pull request #926 from Paike/patch-1
Fallback if container has no IP
2018-01-20 23:04:40 -07:00
32d42ffee7 Update docker-gen to 0.7.4 2018-01-14 15:28:46 -07:00
3fab237f34 Merge pull request #1022 from mouhamed/patch-1
Remove duplicate
2018-01-09 21:29:06 -07:00
1eac894902 Remove duplicate 2018-01-09 21:12:37 +01:00
73f29846b3 Merge pull request #957 from buchdag/ssl-modern
Allow optional use of Mozilla modern SSL configuration
2017-12-06 16:34:30 -07:00
6e9dc343cd Changed the SSL stapling cert extension to pem from crt. SSL stapling was not working due to the incorrect file extension. 2017-11-19 11:35:30 +00:00
35f092ca30 Update doc with SSL_POLICY values 2017-11-18 09:18:55 +01:00
bf16afc665 Use enumerable SSL_POLICY instead of bool 2017-11-18 09:18:55 +01:00
ea80027525 Merge branch 'master' into ssl-modern 2017-11-16 22:47:25 +01:00
a6e8fae7f5 Merge pull request #970 from kamermans/bugfix/failing_ssl_tests
Fixed failing SSL tests
2017-11-09 10:04:20 -07:00
9b8323d2e2 Merge pull request #969 from kamermans/feature/custom_hsts
Added custom HSTS support (issue #953)
2017-11-09 08:47:37 -07:00
612bf72ceb Support old and new versions of requests 2017-11-08 23:19:13 -05:00
ebd1485b09 Catch SSLError instead of CertificateError 2017-11-08 22:53:44 -05:00
58a02f107e Removed '-verify 0' - to disable verification, exclude -verify entirely 2017-11-08 22:42:52 -05:00
a312472fb5 Added custom HSTS support (issue #953) 2017-11-08 22:30:24 -05:00
1374ee5b9e Merge pull request #962 from cglewis/master
MAINTAINER is deprecated, using LABEL now
2017-11-06 11:07:26 -07:00
55610b8425 MAINTAINER is deprecated, using LABEL now 2017-10-31 18:21:12 -07:00
56fb58cc6f Update doc for mozilla modern profile 2017-10-27 10:28:42 +02:00
ea98780960 Enable optional mozilla modern profile 2017-10-27 10:28:42 +02:00
1b868259fe Merge pull request #955 from buchdag/dhparam-separate-container
Fix default dhparam.pem when using separate containers
2017-10-26 10:09:18 -06:00
3ac478f284 Update Diffie-Hellman Groups doc
+ corrected a typo
2017-10-25 12:34:22 +02:00
2528a35656 Don't presume the existence of default dhparam
The default dhparam at /etc/nginx/dhparam/dhparam.pem won't be auto generated with the separate containers setup.
2017-10-25 12:32:09 +02:00
3ef600a3b5 Merge pull request #842 from kamermans/feature/external_internal_network
Allow containers to be restricted to internal network
2017-10-20 10:04:08 -06:00
fc36514eb8 Merge pull request #863 from qiqizjl/master
support fastcgi
2017-10-20 10:00:27 -06:00
795e153c2e Merge pull request #951 from kamermans/bugfix/ipv6_resolvers
Added support for IPv6 DNS servers in resolver generation (issue #938)
2017-10-20 09:50:56 -06:00
5d503b48cb Added support for IPv6 DNS servers in resolver generation (issue #938) 2017-10-19 20:58:34 -04:00
93d90884e2 Implemented NETWORK_ACCESS (squash commit) 2017-10-18 13:29:12 -04:00
92379d8131 Update Readme 2017-09-24 15:15:00 +07:00
31d2ed172b Change ENV variable from GENERATE_DHPARAM to DHPARAM_GENERATION 2017-09-24 15:13:24 +07:00
3156b97f3a Fallback if container has no IP
Sometimes containers will not be assigned an IP (after reboot or due to misconfiguration). This leads to an incorrect "server <missing ip> down;" line in default.conf and crashes nginx. 
@therealgambo  provided a fix for this: https://github.com/jwilder/nginx-proxy/issues/845
2017-09-13 12:37:06 +02:00
a3b1d5b7ab Trigger Build 2017-08-27 13:19:29 +07:00
09271a333a Update Readme 2017-08-27 04:40:47 +07:00
4b22ccdc81 Add ability to opt-out dh param auto generation 2017-08-27 04:40:35 +07:00
f05f7a0ff9 Merge pull request #574 from teohhanhui/ocsp-stapling-chain
Enable OCSP stapling if certificate trust chain is provided
2017-08-16 11:53:17 -06:00
817db85aae Merge pull request #898 from remipichon/master
Do not bind upstream with 'ingress' network
2017-08-16 10:12:18 -06:00
df24d9dff5 Merge pull request #901 from brikou/patch-2
Simplify docker-compose.yml example
2017-08-13 15:57:09 -06:00
343791b657 Simplify docker-compose.yml example
Remove `container_name` as not required
2017-08-12 07:37:05 +02:00
fff84de367 Do not bind upstream with 'ingress' network
Merging https://github.com/jwilder/nginx-proxy/pull/774 and a8ee64b059
2017-08-10 12:30:00 +02:00
065dd7f1ea Fix build 2017-07-31 17:46:58 +08:00
dfe7677eb5 Enable OCSP stapling if certificate trust chain is provided
Previously disabled in 080a5157e6
2017-07-31 17:46:58 +08:00
0cc71fad49 Add dynamically-computed DNS resolvers to nginx (for PR #574) 2017-07-31 17:44:27 +08:00
6bdd184d6a Merge pull request #882 from matt-hh/feature/auto-update-from-upstream-nginx
Move to 1.13 base image to get auto updates
2017-07-21 08:53:48 -06:00
febf85d7e2 Move to 1.13 base image to get auto updates
Less maintenance and more security
Resolves #880
2017-07-21 13:45:33 +02:00
2eb2ae9c93 support fastcgi 2017-06-24 14:48:05 +08:00
29fffd6de8 Revert "support fastcgi"
This reverts commit 8ac755e1d6.
2017-06-24 14:05:42 +08:00
8ac755e1d6 support fastcgi 2017-06-24 13:51:02 +08:00
02121df3b9 Merge pull request #589 from kamermans/feature_ssl_improvement
SSL security enhancement
2017-06-22 11:54:51 -06:00
14779ec4be Merge pull request #860 from jwilder/jw-travis
Update docker
2017-06-22 11:46:48 -06:00
a318b57408 Update docker 2017-06-22 11:36:40 -06:00
57a33aaf8b Merge pull request #849 from Neilpang/Branch_0.6.0
running proxy on host network
2017-06-22 09:50:39 -06:00
026ba7cdac Added DHParam compatibility note 2017-06-18 21:30:59 -04:00
761bbf9dbc Removed duplicate server_names_hash_bucket_size directive 2017-06-18 21:21:05 -04:00
c41186a3a4 Merge branch 'master' into feature_ssl_improvement 2017-06-14 16:31:12 -06:00
90b62e0abc Merge pull request #851 from Neilpang/worker_processes
fix worker_processes to "auto"
2017-06-12 19:23:29 -06:00
a3cd96ead4 alpine fix worker_processes to "auto" 2017-06-13 09:11:27 +08:00
e3b6be79fc Merge pull request #847 from jwilder/appropriate-trim-earlier
Trim $host and $proto before they are used
2017-06-12 09:48:27 -06:00
1867228cce fix worker_processes to "auto" 2017-06-12 15:59:55 +08:00
a8ee64b059 running proxy on host network 2017-06-10 15:07:45 +08:00
4e4733f68e Trim $host and $proto before they are used 2017-06-09 12:55:39 -06:00
23a2c7d848 Merge pull request #812 from thueske/master
Upgrade to 1.13.0
2017-05-04 15:39:57 -06:00
2c4102d396 Upgrade to 1.13.0 2017-05-04 18:57:00 +02:00
fed6df3756 Merge pull request #768 from thomasleveil/wildcard_cert_nohttps
TESTS: add test for wildcard cert + nohttps + default.crt
2017-05-03 17:02:40 -06:00
965c722344 Merge pull request #810 from rtalvarez/readme-typo
Fix README typo
2017-05-03 16:57:40 -06:00
f2487741dc Fix README typo
Fixed a small typo/error with "the a" host
2017-05-03 11:06:34 -05:00
b6a445b1a9 Merge pull request #790 from versada/fix-typo
DOC: fixed typo
2017-04-11 10:48:12 -06:00
cf88817355 DOC: fixed typo 2017-04-11 11:43:47 +03:00
851b0e36cd Merge pull request #789 from matt-hh/feature/upgrade-1.11.13
Upgrade to nginx 1.11.13
2017-04-07 09:38:33 -06:00
172d79aff4 Upgrade to nginx 1.11.13 2017-04-07 12:58:49 +02:00
619943ac1e Merge pull request #770 from sischnei/http2-in-readme
Updated README to include HTTP/2.0
2017-03-18 09:38:16 -06:00
6fd32b5a9b Updated README to include HTTP/2.0 2017-03-18 10:52:43 +01:00
8414a94d59 TESTS: add test for the case in which a wildcard cert matches a container having nohttps set 2017-03-15 02:12:07 +01:00
82133865d4 Merge pull request #767 from thomasleveil/patch-1
DOC: reflect change from PR #344
2017-03-14 18:57:53 -06:00
77e022cf28 DOC: reflect change from PR #344
PR #344 changed the HTTP status code from `503` to `500`. The README.md file was not updated accordingly.
2017-03-15 01:32:47 +01:00
de2f057c10 TESTS: add test for unreachable container
resulting in an empty `upstream {}` block in the generated nginx config file
2017-03-08 21:21:32 +01:00
6dfc3f3f70 TESTS: add stress test when a certificate file is missing 2017-03-08 21:21:32 +01:00
e25c78b00a TESTS: add pytest incremental marker to mark tests as expected to fail if previous test failed
see http://stackoverflow.com/a/12579625/107049
2017-03-08 21:21:32 +01:00
a3fbaa5990 TESTS: add directory for tests featuring scenarios trying to make nginx-proxy fail 2017-03-08 21:21:32 +01:00
6912414750 Merge branch 'master' into feature_ssl_improvement 2017-03-08 11:31:01 -05:00
e373a5199b Merge branch 'master' into feature_ssl_improvement 2017-03-08 10:49:02 -05:00
d5deff21c5 Merge pull request #757 from thomasleveil/issue/755
TEST: fix #755: Tests fail with new Docker version scheme
2017-03-07 23:34:45 -07:00
c2544d4c78 Merge pull request #2 from thomasleveil/PR/589
TESTS: refactor dhparam tests
2017-03-07 20:51:06 -05:00
abdd5883a1 TESTS: refactor dhparam tests 2017-03-08 02:37:12 +01:00
98b5828f83 Modified tests to include dhparams 2017-03-07 14:04:44 -05:00
0244b4e71e Added dhparams test in new format 2017-03-07 14:04:37 -05:00
99a569b2e6 fix #755: Tests fail with new Docker version scheme
Docker introduced a [new version scheme](https://blog.docker.com/2017/03/docker-enterprise-edition/). As the result, the latest docker version is now `17.03.0-ce`.
2017-03-06 23:36:16 +01:00
ad9af2884d Merged master, fixed BATS conflict 2017-03-06 10:48:12 -05:00
6554a1cf28 Merge pull request #732 from matt-hh/feature/upgrade-1.11.10
Upgrade to nginx 1.11.10
2017-02-21 10:18:23 -07:00
7bafa37a52 Upgrade to nginx 1.11.10 2017-02-21 14:03:54 +01:00
9e31d5042f Merge pull request #735 from thomasleveil/test_events
TESTS: add a test to verify nginx conf is updated
2017-02-20 22:57:19 -07:00
2aef648f3d TESTS: add a test to verify nginx conf is update on container creation/deletion 2017-02-21 03:20:38 +01:00
68816390ee Merge pull request #655 from thomasleveil/pytest
rewrite tests using docker-compose and pytest
2017-02-18 09:52:38 -07:00
dd443f3eca TESTS: ignore the requirements and certs directory when collecting tests 2017-02-17 01:24:48 +01:00
9620be91fa TESTS: separated containers: fix indentation and remove dependency over jwilder/whoami image 2017-02-17 01:11:11 +01:00
85370fa31f TESTS: improve error reporting for failed to run docker-compose commands 2017-02-17 00:54:14 +01:00
6069bc53cd TESTS: replace old test suite with the new one
get rid of Bats definitively
2017-02-17 00:29:30 +01:00
250a01d235 TESTS: add tests for IPv6 support 2017-02-16 23:27:28 +01:00
78375632dd TESTS: adjust Travis-CI config (upgrade to docker 1.13 and no more docker-compose) 2017-02-16 21:40:54 +01:00
a6e4f7f3ad TESTS: adjust Travis-CI config 2017-02-16 21:40:54 +01:00
02f9e29a31 TESTS: make pytest verbose by default 2017-02-16 21:40:54 +01:00
9f26efdf86 TESTS: add tests for IPv6 2017-02-16 21:40:54 +01:00
e6b9d2f5e7 TESTS: show skip reason in test summary 2017-02-16 21:40:54 +01:00
eeb27f7b50 TESTS: fix failure raising when cannot get nginx-proxy nginx configuration file 2017-02-16 21:40:54 +01:00
43d8ba0e78 TESTS: add tests for using nginx and docker-gen in separated containers 2017-02-16 21:40:54 +01:00
a533ff6aff TESTS: add support for resolving containers IP address from domain names in the form *.<container name>.container.docker 2017-02-16 21:40:54 +01:00
743d9801e9 TESTS: make test now runs tests from a docker container 2017-02-16 21:40:54 +01:00
e6bc7e6043 TESTS: rename nginx-proxy-tester.sh to test.sh 2017-02-16 21:40:54 +01:00
87926db4c3 TESTS: upgrade to docker python module 2.0.2 and docker-compose 1.11.1 2017-02-16 21:40:54 +01:00
fdde850fc2 TESTS: pytest checks the existance of the jwilder/nginx-proxy:test image 2017-02-16 21:40:54 +01:00
3e92192dc4 TESTS: add test for multiple networks 2017-02-16 21:40:54 +01:00
3ecae2f020 TESTS: the docker_compose pytest fixture is now responsible for attaching the container running pytest to all docker networks 2017-02-16 21:40:54 +01:00
dcf8dd4682 TESTS: refactor conftest.py 2017-02-16 21:40:54 +01:00
3f88ba8903 TESTS: refactor conftest.py 2017-02-16 21:40:54 +01:00
10cd3e5f81 TESTS: refactor conftest.py 2017-02-16 21:40:54 +01:00
ad57c48465 Fixed HTTPS test 2017-02-16 21:40:54 +01:00
912f5615dc Reorganized certs 2017-02-16 21:40:54 +01:00
8995ba02ba Fixed assertion bug 2017-02-16 21:40:54 +01:00
d0e5870060 Added certs, fixed typos 2017-02-16 21:40:54 +01:00
65371e513a Renamed wildcard cert and key 2017-02-16 21:40:54 +01:00
087592df2c TESTS: simplify nginx-proxy-tester.sh 2017-02-16 21:40:54 +01:00
9d8f0db268 TESTS: remove containers after each test 2017-02-16 21:40:54 +01:00
541ce48292 fixup! TESTS: add support for compose syntax v2 2017-02-16 21:40:54 +01:00
889dfea4ca TESTS: adjust logging (when using pytest -s) 2017-02-16 21:40:54 +01:00
150365e784 fixup! TESTS: add test for custom default configuration 2017-02-16 21:40:54 +01:00
23d361d1da TESTS: reorganize tests into subfolders 2017-02-16 21:40:54 +01:00
eeed150858 README: fix instruction for overriding default custom conf 2017-02-16 21:40:54 +01:00
8aa3158952 TESTS: add test for custom default location configuration 2017-02-16 21:40:54 +01:00
713149df8e TESTS: add test for custom default configuration 2017-02-16 21:40:54 +01:00
ee5b0f96ad TESTS: add test for custom per vhost configuration in location block 2017-02-16 21:40:54 +01:00
a283c95e2e TESTS: nginxproxy fixture can provide the nginx generated conf in tests 2017-02-16 21:40:54 +01:00
f512a56faf TESTS: add test for custom per vhost configuration 2017-02-16 21:40:54 +01:00
2425574958 TESTS: add test for custom proxy-wide configuration 2017-02-16 21:40:54 +01:00
73fda600b3 TESTS: add verbosity 2017-02-16 21:40:54 +01:00
0d00bd2322 TESTS: fix passing pytests args to nginx-proxy-tester script 2017-02-16 21:40:54 +01:00
399e19e2dc TESTS: add support for compose syntax v2 2017-02-16 21:40:54 +01:00
787fa28799 TESTS: add script to run the test suite from a docker container 2017-02-16 21:40:54 +01:00
7a4cae050c TESTS: abort test suite if the 'jwilder/nginx-proxy:test' image is missing 2017-02-16 21:40:54 +01:00
86be8a9424 TESTS: fix retry delay 2017-02-16 21:40:54 +01:00
0f1bb344ff TESTS: port tests for #590 to docker-compose test 2017-02-16 21:40:54 +01:00
197d793a25 TESTS: rewrite tests using pytest and docker-compose
Experimentation to see if it is worth the effort
2017-02-16 21:40:54 +01:00
985c46d8b5 Merge pull request #679 from thomasleveil/issue-677
regexp: use sha1 for upstream only if regexp is used
2017-02-16 12:11:06 -07:00
2d588871f0 Merge pull request #719 from thomasleveil/optional_IPv6
optional IPv6 support
2017-02-16 12:09:30 -07:00
c5c6a6149d Merge pull request #724 from rindek/master
First load docker-gen, then nginx
2017-02-16 09:42:22 -07:00
d7a2aa7823 Merge pull request #676 from matt-hh/feature/alpine-readme
Add info about alpine base image
2017-02-16 09:40:12 -07:00
0e94e1e4bd First load docker-gen, then nginx 2017-02-16 10:47:38 +01:00
f0951df040 optional IPv6 support
Fix #127 and fix #717 by improving #713
2017-02-15 11:50:16 +01:00
c0f60087c3 Merge pull request #713 from schrieveslaach/master
Add IPv6 listen address
2017-02-13 09:25:33 -07:00
8b67b2182f Add IPv6 listen address 2017-02-11 13:28:34 +01:00
b9e2053c38 Merge pull request #704 from yosmanyga/patch-1
Fixed typo
2017-02-06 12:43:16 -07:00
cdb38d06ba Merge pull request #706 from matt-hh/feature/upgrade-1.11.9
Upgrade to nginx 1.11.9
2017-02-06 12:38:41 -07:00
15cbb5debf Upgrade to nginx 1.11.9 2017-02-05 21:40:29 +01:00
d8f66e2411 Fixed typo 2017-02-03 16:19:40 -08:00
c0a0300f12 Merge pull request #696 from kevindoveton/master
Update EXPOSE link in README.md
2017-01-26 23:20:40 -07:00
4c06935b62 Update README.md 2017-01-27 13:24:24 +10:30
2be48ec982 Update EXPOSE link in README.md 2017-01-27 13:16:27 +10:30
d320b43476 Merged conflict in BATS SSL test 2017-01-26 13:46:11 -05:00
3f6381d0fa regexp: use sha1 for upstream only if regexp is used
avoid confusions such as in #677
2017-01-14 11:40:33 +01:00
2c5d4ee3a9 Merge pull request #590 from kamermans/feature_nohttps
Added HTTPS_METHOD=nohttps to disable SSL site
2017-01-13 16:16:16 -07:00
276b4dbe3e Merge branch 'master' into feature_nohttps 2017-01-13 13:07:03 -05:00
83a28f47d7 Fixed long server name comment, improved dhparam check 2017-01-12 17:43:13 -05:00
b0de1f19d3 Updated to use 256-bit dhparam in tests 2017-01-12 17:25:31 -05:00
7d253dd0f3 Allow passing DHPARAM_BITS via env, lower bits to 256 for unit tests 2017-01-12 14:55:25 -05:00
dffc0c47cf Tweak test for reliability on Travis-CI 2017-01-12 10:52:56 -05:00
c219822cd8 Typos 2017-01-12 01:53:36 -05:00
f73a52afaf Added BATS tests for dhparam generation 2017-01-12 01:45:46 -05:00
7c0f7b9449 Fixed Alpine image, removed dhparams gen from test units 2017-01-12 00:21:39 -05:00
6242403d33 Added dhparam support for alpine variant 2017-01-11 23:04:24 -05:00
ebfe5e9c17 Added note about background generation 2017-01-11 22:49:55 -05:00
dfdd67f5a4 Implemented background dhparam generation 2017-01-11 22:43:09 -05:00
f186815c2d Merged upstream 2017-01-11 22:42:35 -05:00
8dfe5ae384 Add info about alpine base image
For todo in #558
2017-01-11 16:57:37 +01:00
3d20c626c8 Merge pull request #359 from sw-double/master
Set appropriate X-Forwarded-Ssl header
2017-01-10 09:21:19 -07:00
f1ccde2fe3 Merge pull request #671 from thomasleveil/regex-end-of-line
fix crash when using end-of-string symbol `$` in regex VIRTUAL_HOST
2017-01-10 09:20:28 -07:00
16c9853dc2 Set appropriate X-Forwarded-Ssl header. 2017-01-10 15:44:02 +01:00
019fa89c53 add comment to ease debugging 2017-01-10 10:10:46 +01:00
1bfc1c85ce fix regexp in VIRTUAL_HOST using end-of-string matching () 2017-01-08 01:49:05 +01:00
d8658bd8d9 TEST: wildcards-hosts.bats - add a test which uses regexp end-of-string 2017-01-07 23:50:54 +01:00
a3c6a272f1 TEST: wildcards-hosts.bats - showcase http://foo.bar.why.not.bats-to-infinity-and-beyond/ 2017-01-07 23:33:54 +01:00
f837d1256a Merge pull request #670 from thomasleveil/parallel-tests
TRAVIS: run debian and alpine tests in parallel
2017-01-07 14:04:40 -07:00
8d017504c0 TRAVIS: run debian and alpine tests in parallel 2017-01-07 21:07:34 +01:00
31a0a844e3 Merge pull request #558 from matt-hh/alpine
Add alpine base image
2017-01-05 18:05:38 -07:00
e9a5519fb0 Merge pull request #611 from MichaelSp/patch-1
add link to letsencrypt-nginx-proxy-companion
2016-12-30 15:26:40 -07:00
a7bc426b61 Merge pull request #666 from matt-hh/feature/upgrade-1.11.8
Upgrade to nginx 1.11.8
2016-12-28 18:42:02 -07:00
c1d93d112a Upgrade nginx-alpine to 1.11.8 2016-12-29 00:18:06 +01:00
2a8f4554a7 Merge branch 'master' into alpine
* master:
  Updated nginx to 1.11.6
  Travis-CI's apt-get doesn't have --allow-downgrades yet, which is annoying because --force-yes is deprecated
  Put --allow-downgrades in the right place
  Upgrade docker-engine and allow downgrades
  Clarified a couple parts in the README
  Comment typo
  Added httpoxy test
  Updated README to reflect X-Forwarded-Port
  Implemented more advanced webserver with routing and request header echoing, added header tests
  Honor upstream forwarded port if available
  add ssl_session_tickets to default site
  Replace "replace" to "trimSuffix"
  do not enable HSTS for subdomains
  Remove proxy-tier network in favor of the default.
  Added X-Forwarded-Port
  Add docker-compose file for separate containers.
  connect to uWSGI backends
2016-12-29 00:02:05 +01:00
004cc3cb8c Upgrade to nginx 1.11.8 2016-12-28 23:38:47 +01:00
6186fbf8b0 Merge pull request #653 from cramaker/feature/nginx-1.11.6
Updated nginx to 1.11.6
2016-12-08 12:59:56 -07:00
b66398d1bf Updated nginx to 1.11.6 2016-12-08 13:24:49 -06:00
40872c9b43 Merge pull request #649 from kamermans/travisci_fix
Travis-CI - upgrade docker-engine and allow downgrades
2016-12-05 10:10:27 -07:00
59b8806859 Travis-CI's apt-get doesn't have --allow-downgrades yet, which is annoying because --force-yes is deprecated 2016-12-05 09:33:44 -05:00
271729aaaa Put --allow-downgrades in the right place 2016-12-05 09:29:08 -05:00
dc910107cf Upgrade docker-engine and allow downgrades 2016-12-05 09:21:39 -05:00
fc7653bf3d Merge branch 'master' into feature_nohttps 2016-12-05 09:06:39 -05:00
e60fefad27 Merge pull request #587 from kamermans/feature_x_forwarded_port
Added X-Forwarded-Port and proxy headers tests
2016-12-02 11:17:44 -07:00
1a608eaefb add link to letsencrypt-nginx-proxy-companion 2016-10-22 14:31:57 +02:00
b0de80d46b Moved config edits from Dockerfile to template 2016-10-03 10:21:31 -04:00
8534185b0c Added newline to config 2016-10-03 10:05:55 -04:00
8cf0b75d80 Updated README with HTTPS_METHOD=nohttps 2016-10-01 11:25:11 -04:00
374b1256cd Add HTTPS_METHOD=https to disable SSL site 2016-10-01 11:22:48 -04:00
c091d08fee Updated docs for issue #562 2016-09-29 22:24:06 -04:00
ebbf7a7b74 Expanded documentation in SSL/TLS support 2016-09-29 21:57:28 -04:00
d3a0da451a TLSv1 End-of-life pushed to June 30, 2018, rolled back for compatibility 2016-09-29 21:35:37 -04:00
c51c9980cf Removed TLS 1.0 as it is considered unsafe and must be disabled for PCI compliance 2016-09-29 19:52:20 -04:00
6f2b3f1c54 Issue #586 Removed DES-based SSL ciphers 2016-09-29 17:10:17 -04:00
0b1e9e56e1 Issue #535 Added default 2048-bit dhparam.pem file 2016-09-29 16:48:18 -04:00
9ef0bb3356 Comment typo 2016-09-29 16:06:53 -04:00
b9bf183df2 Added httpoxy test 2016-09-29 15:43:07 -04:00
7422539f20 Updated README to reflect X-Forwarded-Port 2016-09-29 15:42:49 -04:00
112aad39b6 Implemented more advanced webserver with routing and request header echoing, added header tests 2016-09-29 15:36:01 -04:00
124b8cd757 Honor upstream forwarded port if available 2016-09-29 11:33:21 -04:00
6ebbdb10c7 Merge branch 'master' into feature_x_forwarded_port 2016-09-29 11:26:51 -04:00
7d05f0d924 Add nginx alpine to update-dependencies task 2016-09-03 12:05:27 +02:00
ba55d1a0b6 Add alpine base image
- Inspired by #408
- Possible solution for #543
2016-09-02 17:11:36 +02:00
2e29168d92 Added X-Forwarded-Port 2016-07-21 11:23:35 -04:00
305 changed files with 11113 additions and 2272 deletions

View File

@ -1,6 +1,9 @@
.git
.github
test
.dockerignore
circle.yml
.gitignore
*.yml
Dockerfile*
Makefile
README.md
test

35
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,35 @@
# ⚠️ PLEASE READ ⚠️
## Questions or Features
If you have a question or want to request a feature, please **DO NOT SUBMIT** a new issue.
Instead please use the relevant Discussions section's category:
- 🙏 [Ask a question](https://github.com/nginx-proxy/nginx-proxy/discussions/categories/q-a)
- 💡 [Request a feature](https://github.com/nginx-proxy/nginx-proxy/discussions/categories/ideas)
## Bugs
If you are logging a bug, please search the current open issues first to see if there is already a bug opened.
For bugs, the easier you make it to reproduce the issue you see and the more initial information you provide, the easier and faster the bug can be identified and can get fixed.
Please at least provide:
- the exact nginx-proxy version you're using (if using `latest` please make sure it is up to date and provide the version number printed at container startup).
- complete configuration (compose file, command line, etc) of both your nginx-proxy container(s) and proxied containers. You should redact sensitive info if needed but please provide **full** configurations.
- generated nginx configuration obtained with `docker exec nameofyournginxproxycontainer nginx -T`
If you can provide a script or docker-compose file that reproduces the problems, that is very helpful.
## General advice about `latest`
Do not use the `latest` tag for production setups.
`latest` is nothing more than a convenient default used by Docker if no specific tag is provided, there isn't any strict convention on what goes into this tag over different projects, and it does not carry any promise of stability.
Using `latest` will most certainly put you at risk of experiencing uncontrolled updates to non backward compatible versions (or versions with breaking changes) and makes it harder for maintainers to track which exact version of the container you are experiencing an issue with.
This recommendation stands for pretty much every Docker image in existence, not just nginx-proxy's ones.
Thanks,
Nicolas

32
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,32 @@
version: 2
updates:
# Maintain dependencies for Docker
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: "build"
labels:
- "type/build"
- "scope/dockerfile"
# Maintain Python dependencies (test suite)
- package-ecosystem: "pip"
directory: "/test/requirements"
schedule:
interval: "weekly"
commit-message:
prefix: "ci"
labels:
- "type/ci"
# Maintain GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "ci"
labels:
- "type/ci"

View File

@ -0,0 +1,85 @@
name: Build and publish Docker images on demand
on:
workflow_dispatch:
inputs:
image_tag:
description: "Image tag"
type: string
required: true
jobs:
multiarch-build:
name: Build and publish ${{ matrix.base }} image with tag ${{ inputs.image_tag }}
strategy:
matrix:
base: [alpine, debian]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Retrieve nginx-proxy version
id: nginx-proxy_version
run: echo "VERSION=$(git describe --tags)" >> "$GITHUB_OUTPUT"
- name: Retrieve docker-gen version
id: docker-gen_version
run: sed -n -e 's;^FROM nginxproxy/docker-gen:\([0-9.]*\).*;VERSION=\1;p' Dockerfile.${{ matrix.base }} >> "$GITHUB_OUTPUT"
- name: Get Docker tags
id: docker_meta
uses: docker/metadata-action@v5
with:
images: |
nginxproxy/nginx-proxy
tags: |
type=raw,value=${{ inputs.image_tag }},enable=${{ matrix.base == 'debian' }}
type=raw,value=${{ inputs.image_tag }},suffix=-alpine,enable=${{ matrix.base == 'alpine' }}
labels: |
org.opencontainers.image.authors=Nicolas Duchon <nicolas.duchon@gmail.com> (@buchdag), Jason Wilder
org.opencontainers.image.version=${{ steps.nginx-proxy_version.outputs.VERSION }}
flavor: |
latest=false
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push the image
id: docker_build
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.${{ matrix.base }}
build-args: |
NGINX_PROXY_VERSION=${{ steps.nginx-proxy_version.outputs.VERSION }}
DOCKER_GEN_VERSION=${{ steps.docker-gen_version.outputs.VERSION }}
platforms: linux/amd64,linux/arm64,linux/s390x,linux/arm/v7
sbom: true
push: true
provenance: mode=max
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Images digests
run: echo ${{ steps.docker_build.outputs.digest }}

101
.github/workflows/build-publish.yml vendored Normal file
View File

@ -0,0 +1,101 @@
name: Build and publish Docker images
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 1"
push:
branches:
- main
tags:
- "*.*.*"
paths-ignore:
- "test/*"
- ".gitignore"
- "docker-compose-separate-containers.yml"
- "docker-compose.yml"
- "LICENSE"
- "Makefile"
- "*.md"
jobs:
multiarch-build:
name: Build and publish image
strategy:
matrix:
base: [alpine, debian]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Retrieve nginx-proxy version
id: nginx-proxy_version
run: echo "VERSION=$(git describe --tags)" >> "$GITHUB_OUTPUT"
- name: Retrieve docker-gen version
id: docker-gen_version
run: sed -n -e 's;^FROM nginxproxy/docker-gen:\([0-9.]*\).*;VERSION=\1;p' Dockerfile.${{ matrix.base }} >> "$GITHUB_OUTPUT"
- name: Get Docker tags
id: docker_meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/nginx-proxy/nginx-proxy
nginxproxy/nginx-proxy
jwilder/nginx-proxy
tags: |
type=semver,pattern={{version}},enable=${{ matrix.base == 'debian' }}
type=semver,pattern={{major}}.{{minor}},enable=${{ matrix.base == 'debian' }}
type=semver,suffix=-alpine,pattern={{version}},enable=${{ matrix.base == 'alpine' }}
type=semver,suffix=-alpine,pattern={{major}}.{{minor}},enable=${{ matrix.base == 'alpine' }}
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' && matrix.base == 'debian' }}
type=raw,value=alpine,enable=${{ github.ref == 'refs/heads/main' && matrix.base == 'alpine' }}
labels: |
org.opencontainers.image.authors=Nicolas Duchon <nicolas.duchon@gmail.com> (@buchdag), Jason Wilder
org.opencontainers.image.version=${{ steps.nginx-proxy_version.outputs.VERSION }}
flavor: |
latest=false
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push the image
id: docker_build
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.${{ matrix.base }}
build-args: |
NGINX_PROXY_VERSION=${{ steps.nginx-proxy_version.outputs.VERSION }}
DOCKER_GEN_VERSION=${{ steps.docker-gen_version.outputs.VERSION }}
platforms: linux/amd64,linux/arm64,linux/s390x,linux/arm/v7
sbom: true
push: true
provenance: mode=max
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Images digests
run: echo ${{ steps.docker_build.outputs.digest }}

View File

@ -0,0 +1,27 @@
name: Update Docker Hub Description
on:
push:
branches:
- main
paths:
- README.md
- .github/workflows/dockerhub-description.yml
jobs:
dockerHubDescription:
name: Update Docker Hub Description
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN_RWD }}
repository: nginxproxy/nginx-proxy
short-description: ${{ github.event.repository.description }}
enable-url-completion: true

50
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,50 @@
name: Tests
on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- "LICENSE"
- "**.md"
pull_request:
paths-ignore:
- "LICENSE"
- "**.md"
jobs:
unit:
name: Unit Tests
runs-on: ubuntu-latest
strategy:
matrix:
base_docker_image: [alpine, debian]
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r python-requirements.txt
working-directory: test/requirements
- name: Pull nginx:alpine image
run: docker pull nginx:alpine
- name: Build Docker web server image
run: make build-webserver
- name: Build Docker nginx proxy test image
run: make build-nginx-proxy-test-${{ matrix.base_docker_image }}
- name: Run tests
run: pytest
working-directory: test

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
**/__pycache__/
**/.cache/
.idea/
wip

View File

@ -1,22 +0,0 @@
sudo: required
services:
- docker
env:
global:
- DOCKER_VERSION=1.12.1-0~trusty
before_install:
# list docker-engine versions
- apt-cache madison docker-engine
# upgrade docker-engine to specific version
- sudo apt-get -o Dpkg::Options::="--force-confnew" install -y docker-engine=${DOCKER_VERSION}
- docker version
- docker info
- sudo add-apt-repository ppa:duggan/bats --yes
- sudo apt-get update -qq
- sudo apt-get install -qq bats
- make update-dependencies
script:
- make test

View File

@ -1,34 +0,0 @@
FROM nginx:1.11.3
MAINTAINER Jason Wilder mail@jasonwilder.com
# Install wget and install/updates certificates
RUN apt-get update \
&& apt-get install -y -q --no-install-recommends \
ca-certificates \
wget \
&& apt-get clean \
&& rm -r /var/lib/apt/lists/*
# Configure Nginx and apply fix for very long server names
RUN echo "daemon off;" >> /etc/nginx/nginx.conf \
&& sed -i 's/^http {/&\n server_names_hash_bucket_size 128;/g' /etc/nginx/nginx.conf
# Install Forego
ADD https://github.com/jwilder/forego/releases/download/v0.16.1/forego /usr/local/bin/forego
RUN chmod u+x /usr/local/bin/forego
ENV DOCKER_GEN_VERSION 0.7.3
RUN wget https://github.com/jwilder/docker-gen/releases/download/$DOCKER_GEN_VERSION/docker-gen-linux-amd64-$DOCKER_GEN_VERSION.tar.gz \
&& tar -C /usr/local/bin -xvzf docker-gen-linux-amd64-$DOCKER_GEN_VERSION.tar.gz \
&& rm /docker-gen-linux-amd64-$DOCKER_GEN_VERSION.tar.gz
COPY . /app/
WORKDIR /app/
ENV DOCKER_HOST unix:///tmp/docker.sock
VOLUME ["/etc/nginx/certs"]
ENTRYPOINT ["/app/docker-entrypoint.sh"]
CMD ["forego", "start", "-r"]

38
Dockerfile.alpine Normal file
View File

@ -0,0 +1,38 @@
FROM docker.io/nginxproxy/docker-gen:0.14.5 AS docker-gen
FROM docker.io/nginxproxy/forego:0.18.2 AS forego
# Build the final image
FROM docker.io/library/nginx:1.27.3-alpine
ARG NGINX_PROXY_VERSION
# Add DOCKER_GEN_VERSION environment variable because
# acme-companion rely on it (but the actual value is not important)
ARG DOCKER_GEN_VERSION="unknown"
ENV NGINX_PROXY_VERSION=${NGINX_PROXY_VERSION} \
DOCKER_GEN_VERSION=${DOCKER_GEN_VERSION} \
DOCKER_HOST=unix:///tmp/docker.sock
# Install dependencies
RUN apk add --no-cache --virtual .run-deps bash openssl
# Configure Nginx
RUN echo -e "\ninclude /etc/nginx/toplevel.conf.d/*.conf;" >> /etc/nginx/nginx.conf \
&& sed -i 's/worker_connections.*;$/worker_connections 10240;/' /etc/nginx/nginx.conf \
&& sed -i -e '/^\}$/{s//\}\nworker_rlimit_nofile 20480;/;:a' -e '$!N;$!ba' -e '}' /etc/nginx/nginx.conf \
&& mkdir -p '/etc/nginx/toplevel.conf.d' \
&& mkdir -p '/etc/nginx/dhparam' \
&& mkdir -p '/etc/nginx/certs' \
&& mkdir -p '/usr/share/nginx/html/errors'
# Install Forego + docker-gen
COPY --from=forego /usr/local/bin/forego /usr/local/bin/forego
COPY --from=docker-gen /usr/local/bin/docker-gen /usr/local/bin/docker-gen
COPY network_internal.conf /etc/nginx/
COPY app nginx.tmpl LICENSE /app/
WORKDIR /app/
ENTRYPOINT ["/app/docker-entrypoint.sh"]
CMD ["forego", "start", "-r"]

35
Dockerfile.debian Normal file
View File

@ -0,0 +1,35 @@
FROM docker.io/nginxproxy/docker-gen:0.14.5-debian AS docker-gen
FROM docker.io/nginxproxy/forego:0.18.2-debian AS forego
# Build the final image
FROM docker.io/library/nginx:1.27.3
ARG NGINX_PROXY_VERSION
# Add DOCKER_GEN_VERSION environment variable because
# acme-companion rely on it (but the actual value is not important)
ARG DOCKER_GEN_VERSION="unknown"
ENV NGINX_PROXY_VERSION=${NGINX_PROXY_VERSION} \
DOCKER_GEN_VERSION=${DOCKER_GEN_VERSION} \
DOCKER_HOST=unix:///tmp/docker.sock
# Configure Nginx
RUN echo "\ninclude /etc/nginx/toplevel.conf.d/*.conf;" >> /etc/nginx/nginx.conf \
&& sed -i 's/worker_connections.*;$/worker_connections 10240;/' /etc/nginx/nginx.conf \
&& sed -i -e '/^\}$/{s//\}\nworker_rlimit_nofile 20480;/;:a' -e '$!N;$!ba' -e '}' /etc/nginx/nginx.conf \
&& mkdir -p '/etc/nginx/toplevel.conf.d' \
&& mkdir -p '/etc/nginx/dhparam' \
&& mkdir -p '/etc/nginx/certs' \
&& mkdir -p '/usr/share/nginx/html/errors'
# Install Forego + docker-gen
COPY --from=forego /usr/local/bin/forego /usr/local/bin/forego
COPY --from=docker-gen /usr/local/bin/docker-gen /usr/local/bin/docker-gen
COPY network_internal.conf /etc/nginx/
COPY app nginx.tmpl LICENSE /app/
WORKDIR /app/
ENTRYPOINT ["/app/docker-entrypoint.sh"]
CMD ["forego", "start", "-r"]

View File

@ -1,6 +1,7 @@
The MIT License (MIT)
Copyright (c) 2014 Jason Wilder
Copyright (c) 2014-2020 Jason Wilder
Copyright (c) 2021-2022 Nicolas Duchon
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,14 +1,20 @@
.SILENT :
.PHONY : test
.PHONY : test-debian test-alpine test
update-dependencies:
docker pull jwilder/docker-gen:0.7.3
docker pull nginx:1.11.3
docker pull python:3
docker pull rancher/socat-docker:latest
docker pull appropriate/curl:latest
docker pull docker:1.10
test:
docker build -t jwilder/nginx-proxy:bats .
bats test
build-webserver:
docker build --pull -t web test/requirements/web
build-nginx-proxy-test-debian:
docker build --pull --build-arg NGINX_PROXY_VERSION="test" -f Dockerfile.debian -t nginxproxy/nginx-proxy:test .
build-nginx-proxy-test-alpine:
docker build --pull --build-arg NGINX_PROXY_VERSION="test" -f Dockerfile.alpine -t nginxproxy/nginx-proxy:test .
test-debian: build-webserver build-nginx-proxy-test-debian
test/pytest.sh
test-alpine: build-webserver build-nginx-proxy-test-alpine
test/pytest.sh
test: test-debian test-alpine

315
README.md
View File

@ -1,302 +1,77 @@
![nginx 1.11.3](https://img.shields.io/badge/nginx-1.11.3-brightgreen.svg) ![License MIT](https://img.shields.io/badge/license-MIT-blue.svg) [![Build Status](https://travis-ci.org/jwilder/nginx-proxy.svg?branch=master)](https://travis-ci.org/jwilder/nginx-proxy) [![](https://img.shields.io/docker/stars/jwilder/nginx-proxy.svg)](https://hub.docker.com/r/jwilder/nginx-proxy 'DockerHub') [![](https://img.shields.io/docker/pulls/jwilder/nginx-proxy.svg)](https://hub.docker.com/r/jwilder/nginx-proxy 'DockerHub')
[![Test](https://github.com/nginx-proxy/nginx-proxy/actions/workflows/test.yml/badge.svg)](https://github.com/nginx-proxy/nginx-proxy/actions/workflows/test.yml)
[![GitHub release](https://img.shields.io/github/v/release/nginx-proxy/nginx-proxy)](https://github.com/nginx-proxy/nginx-proxy/releases)
[![nginx 1.27.3](https://img.shields.io/badge/nginx-1.27.3-brightgreen.svg?logo=nginx)](https://nginx.org/en/CHANGES)
[![Docker Image Size](https://img.shields.io/docker/image-size/nginxproxy/nginx-proxy?sort=semver)](https://hub.docker.com/r/nginxproxy/nginx-proxy "Click to view the image on Docker Hub")
[![Docker stars](https://img.shields.io/docker/stars/nginxproxy/nginx-proxy.svg)](https://hub.docker.com/r/nginxproxy/nginx-proxy "DockerHub")
[![Docker pulls](https://img.shields.io/docker/pulls/nginxproxy/nginx-proxy.svg)](https://hub.docker.com/r/nginxproxy/nginx-proxy "DockerHub")
nginx-proxy sets up a container running nginx and [docker-gen](https://github.com/nginx-proxy/docker-gen). docker-gen generates reverse proxy configs for nginx and reloads nginx when containers are started and stopped.
nginx-proxy sets up a container running nginx and [docker-gen][1]. docker-gen generates reverse proxy configs for nginx and reloads nginx when containers are started and stopped.
See [Automated Nginx Reverse Proxy for Docker][2] for why you might want to use this.
See [Automated Nginx Reverse Proxy for Docker](http://jasonwilder.com/blog/2014/03/25/automated-nginx-reverse-proxy-for-docker/) for why you might want to use this.
### Usage
To run it:
$ docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock:ro jwilder/nginx-proxy
Then start any containers you want proxied with an env var `VIRTUAL_HOST=subdomain.youdomain.com`
$ docker run -e VIRTUAL_HOST=foo.bar.com ...
The containers being proxied must [expose](https://docs.docker.com/reference/run/#expose-incoming-ports) the port to be proxied, either by using the `EXPOSE` directive in their `Dockerfile` or by using the `--expose` flag to `docker run` or `docker create`.
Provided your DNS is setup to forward foo.bar.com to the a host running nginx-proxy, the request will be routed to a container with the VIRTUAL_HOST env var set.
### Docker Compose
```yaml
version: '2'
services:
nginx-proxy:
image: jwilder/nginx-proxy
container_name: nginx-proxy
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
whoami:
image: jwilder/whoami
container_name: whoami
environment:
- VIRTUAL_HOST=whoami.local
```console
docker run --detach \
--name nginx-proxy \
--publish 80:80 \
--volume /var/run/docker.sock:/tmp/docker.sock:ro \
nginxproxy/nginx-proxy:1.6
```
```shell
$ docker-compose up
$ curl -H "Host: whoami.local" localhost
I'm 5b129ab83266
```
### Multiple Ports
If your container exposes multiple ports, nginx-proxy will default to the service running on port 80. If you need to specify a different port, you can set a VIRTUAL_PORT env var to select a different one. If your container only exposes one port and it has a VIRTUAL_HOST env var set, that port will be selected.
[1]: https://github.com/jwilder/docker-gen
[2]: http://jasonwilder.com/blog/2014/03/25/automated-nginx-reverse-proxy-for-docker/
### Multiple Hosts
If you need to support multiple virtual hosts for a container, you can separate each entry with commas. For example, `foo.bar.com,baz.bar.com,bar.com` and each host will be setup the same.
### Wildcard Hosts
You can also use wildcards at the beginning and the end of host name, like `*.bar.com` or `foo.bar.*`. Or even a regular expression, which can be very useful in conjunction with a wildcard DNS service like [xip.io](http://xip.io), using `~^foo\.bar\..*\.xip\.io` will match `foo.bar.127.0.0.1.xip.io`, `foo.bar.10.0.2.2.xip.io` and all other given IPs. More information about this topic can be found in the nginx documentation about [`server_names`](http://nginx.org/en/docs/http/server_names.html).
### Multiple Networks
With the addition of [overlay networking](https://docs.docker.com/engine/userguide/networking/get-started-overlay/) in Docker 1.9, your `nginx-proxy` container may need to connect to backend containers on multiple networks. By default, if you don't pass the `--net` flag when your `nginx-proxy` container is created, it will only be attached to the default `bridge` network. This means that it will not be able to connect to containers on networks other than `bridge`.
If you want your `nginx-proxy` container to be attached to a different network, you must pass the `--net=my-network` option in your `docker create` or `docker run` command. At the time of this writing, only a single network can be specified at container creation time. To attach to other networks, you can use the `docker network connect` command after your container is created:
Then start any containers (here an nginx container) you want proxied with an env var `VIRTUAL_HOST=subdomain.yourdomain.com`
```console
$ docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock:ro \
--name my-nginx-proxy --net my-network jwilder/nginx-proxy
$ docker network connect my-other-network my-nginx-proxy
docker run --detach \
--name your-proxied-app \
--env VIRTUAL_HOST=foo.bar.com \
nginx
```
In this example, the `my-nginx-proxy` container will be connected to `my-network` and `my-other-network` and will be able to proxy to other containers attached to those networks.
Provided your DNS is setup to resolve `foo.bar.com` to the host running nginx-proxy, a request to `http://foo.bar.com` will then be routed to a container with the `VIRTUAL_HOST` env var set to `foo.bar.com` (in this case, the **your-proxied-app** container).
### SSL Backends
The containers being proxied must :
If you would like the reverse proxy to connect to your backend using HTTPS instead of HTTP, set `VIRTUAL_PROTO=https` on the backend container.
- [expose](https://docs.docker.com/engine/reference/run/#expose-incoming-ports) the port to be proxied, either by using the `EXPOSE` directive in their `Dockerfile` or by using the `--expose` flag to `docker run` or `docker create`.
- share at least one Docker network with the nginx-proxy container: by default, if you don't pass the `--net` flag when your nginx-proxy container is created, it will only be attached to the default bridge network. This means that it will not be able to connect to containers on networks other than bridge.
### uWSGI Backends
Note: providing a port number in `VIRTUAL_HOST` isn't suported, please see [virtual ports](https://github.com/nginx-proxy/nginx-proxy/tree/main/docs#virtual-ports) or [custom external HTTP/HTTPS ports](https://github.com/nginx-proxy/nginx-proxy/tree/main/docs#custom-external-httphttps-ports) depending on what you want to achieve.
If you would like to connect to uWSGI backend, set `VIRTUAL_PROTO=uwsgi` on the
backend container. Your backend container should than listen on a port rather
than a socket and expose that port.
### Image variants
### Default Host
The nginx-proxy images are available in two flavors.
To set the default host for nginx use the env var `DEFAULT_HOST=foo.bar.com` for example
#### Debian based version
$ docker run -d -p 80:80 -e DEFAULT_HOST=foo.bar.com -v /var/run/docker.sock:/tmp/docker.sock:ro jwilder/nginx-proxy
### Separate Containers
nginx-proxy can also be run as two separate containers using the [jwilder/docker-gen](https://index.docker.io/u/jwilder/docker-gen/)
image and the official [nginx](https://registry.hub.docker.com/_/nginx/) image.
You may want to do this to prevent having the docker socket bound to a publicly exposed container service.
You can demo this pattern with docker-compose:
This image is based on the nginx:mainline image, itself based on the debian slim image.
```console
$ docker-compose --file docker-compose-separate-containers.yml up
$ curl -H "Host: whoami.local" localhost
I'm 5b129ab83266
docker pull nginxproxy/nginx-proxy:1.6
```
To run nginx proxy as a separate container you'll need to have [nginx.tmpl](https://github.com/jwilder/nginx-proxy/blob/master/nginx.tmpl) on your host system.
#### Alpine based version (`-alpine` suffix)
First start nginx with a volume:
This image is based on the nginx:alpine image.
$ docker run -d -p 80:80 --name nginx -v /tmp/nginx:/etc/nginx/conf.d -t nginx
Then start the docker-gen container with the shared volume and template:
```
$ docker run --volumes-from nginx \
-v /var/run/docker.sock:/tmp/docker.sock:ro \
-v $(pwd):/etc/docker-gen/templates \
-t jwilder/docker-gen -notify-sighup nginx -watch /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
```console
docker pull nginxproxy/nginx-proxy:1.6-alpine
```
Finally, start your containers with `VIRTUAL_HOST` environment variables.
> [!IMPORTANT]
>
> #### A note on `latest` and `alpine`:
>
> It is not recommended to use the `latest` (`nginxproxy/nginx-proxy`, `nginxproxy/nginx-proxy:latest`) or `alpine` (`nginxproxy/nginx-proxy:alpine`) tag for production setups.
>
> [Those tags point](https://hub.docker.com/r/nginxproxy/nginx-proxy/tags) to the latest commit in the `main` branch. They do not carry any promise of stability, and using them will probably put your nginx-proxy setup at risk of experiencing uncontrolled updates to non backward compatible versions (or versions with breaking changes). You should always specify the version you want to use explicitly to ensure your setup doesn't break when the image is updated.
$ docker run -e VIRTUAL_HOST=foo.bar.com ...
### Additional documentation
### SSL Support
Please check the [docs section](https://github.com/nginx-proxy/nginx-proxy/tree/main/docs).
SSL is supported using single host, wildcard and SNI certificates using naming conventions for
certificates or optionally specifying a cert name (for SNI) as an environment variable.
### Powered by
To enable SSL:
$ docker run -d -p 80:80 -p 443:443 -v /path/to/certs:/etc/nginx/certs -v /var/run/docker.sock:/tmp/docker.sock:ro jwilder/nginx-proxy
The contents of `/path/to/certs` should contain the certificates and private keys for any virtual
hosts in use. The certificate and keys should be named after the virtual host with a `.crt` and
`.key` extension. For example, a container with `VIRTUAL_HOST=foo.bar.com` should have a
`foo.bar.com.crt` and `foo.bar.com.key` file in the certs directory.
If you are running the container in a virtualized environment (Hyper-V, VirtualBox, etc...),
/path/to/certs must exist in that environment or be made accessible to that environment.
By default, Docker is not able to mount directories on the host machine to containers running in a virtual machine.
#### Diffie-Hellman Groups
If you have Diffie-Hellman groups enabled, the files should be named after the virtual host with a
`dhparam` suffix and `.pem` extension. For example, a container with `VIRTUAL_HOST=foo.bar.com`
should have a `foo.bar.com.dhparam.pem` file in the certs directory.
#### Wildcard Certificates
Wildcard certificates and keys should be named after the domain name with a `.crt` and `.key` extension.
For example `VIRTUAL_HOST=foo.bar.com` would use cert name `bar.com.crt` and `bar.com.key`.
#### SNI
If your certificate(s) supports multiple domain names, you can start a container with `CERT_NAME=<name>`
to identify the certificate to be used. For example, a certificate for `*.foo.com` and `*.bar.com`
could be named `shared.crt` and `shared.key`. A container running with `VIRTUAL_HOST=foo.bar.com`
and `CERT_NAME=shared` will then use this shared cert.
#### How SSL Support Works
The SSL cipher configuration is based on [mozilla nginx intermediate profile](https://wiki.mozilla.org/Security/Server_Side_TLS#Nginx) which
should provide compatibility with clients back to Firefox 1, Chrome 1, IE 7, Opera 5, Safari 1,
Windows XP IE8, Android 2.3, Java 7. The configuration also enables HSTS, and SSL
session caches.
The default behavior for the proxy when port 80 and 443 are exposed is as follows:
* If a container has a usable cert, port 80 will redirect to 443 for that container so that HTTPS
is always preferred when available.
* If the container does not have a usable cert, a 503 will be returned.
Note that in the latter case, a browser may get an connection error as no certificate is available
to establish a connection. A self-signed or generic cert named `default.crt` and `default.key`
will allow a client browser to make a SSL connection (likely w/ a warning) and subsequently receive
a 503.
To serve traffic in both SSL and non-SSL modes without redirecting to SSL, you can include the
environment variable `HTTPS_METHOD=noredirect` (the default is `HTTPS_METHOD=redirect`). You can also
disable the non-SSL site entirely with `HTTPS_METHOD=nohttp`. `HTTPS_METHOD` must be specified
on each container for which you want to override the default behavior. If `HTTPS_METHOD=noredirect` is
used, Strict Transport Security (HSTS) is disabled to prevent HTTPS users from being redirected by the
client. If you cannot get to the HTTP site after changing this setting, your browser has probably cached
the HSTS policy and is automatically redirecting you back to HTTPS. You will need to clear your browser's
HSTS cache or use an incognito window / different browser.
### Basic Authentication Support
In order to be able to secure your virtual host, you have to create a file named as its equivalent VIRTUAL_HOST variable on directory
/etc/nginx/htpasswd/$VIRTUAL_HOST
```
$ docker run -d -p 80:80 -p 443:443 \
-v /path/to/htpasswd:/etc/nginx/htpasswd \
-v /path/to/certs:/etc/nginx/certs \
-v /var/run/docker.sock:/tmp/docker.sock:ro \
jwilder/nginx-proxy
```
You'll need apache2-utils on the machine where you plan to create the htpasswd file. Follow these [instructions](http://httpd.apache.org/docs/2.2/programs/htpasswd.html)
### Custom Nginx Configuration
If you need to configure Nginx beyond what is possible using environment variables, you can provide custom configuration files on either a proxy-wide or per-`VIRTUAL_HOST` basis.
#### Replacing default proxy settings
If you want to replace the default proxy settings for the nginx container, add a configuration file at `/etc/nginx/proxy.conf`. A file with the default settings would
look like this:
```Nginx
# HTTP 1.1 support
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
# Mitigate httpoxy attack (see README for details)
proxy_set_header Proxy "";
```
***NOTE***: If you provide this file it will replace the defaults; you may want to check the .tmpl file to make sure you have all of the needed options.
***NOTE***: The default configuration blocks the `Proxy` HTTP request header from being sent to downstream servers. This prevents attackers from using the so-called [httpoxy attack](http://httpoxy.org). There is no legitimate reason for a client to send this header, and there are many vulnerable languages / platforms (`CVE-2016-5385`, `CVE-2016-5386`, `CVE-2016-5387`, `CVE-2016-5388`, `CVE-2016-1000109`, `CVE-2016-1000110`, `CERT-VU#797896`).
#### Proxy-wide
To add settings on a proxy-wide basis, add your configuration file under `/etc/nginx/conf.d` using a name ending in `.conf`.
This can be done in a derived image by creating the file in a `RUN` command or by `COPY`ing the file into `conf.d`:
```Dockerfile
FROM jwilder/nginx-proxy
RUN { \
echo 'server_tokens off;'; \
echo 'client_max_body_size 100m;'; \
} > /etc/nginx/conf.d/my_proxy.conf
```
Or it can be done by mounting in your custom configuration in your `docker run` command:
$ docker run -d -p 80:80 -p 443:443 -v /path/to/my_proxy.conf:/etc/nginx/conf.d/my_proxy.conf:ro -v /var/run/docker.sock:/tmp/docker.sock:ro jwilder/nginx-proxy
#### Per-VIRTUAL_HOST
To add settings on a per-`VIRTUAL_HOST` basis, add your configuration file under `/etc/nginx/vhost.d`. Unlike in the proxy-wide case, which allows multiple config files with any name ending in `.conf`, the per-`VIRTUAL_HOST` file must be named exactly after the `VIRTUAL_HOST`.
In order to allow virtual hosts to be dynamically configured as backends are added and removed, it makes the most sense to mount an external directory as `/etc/nginx/vhost.d` as opposed to using derived images or mounting individual configuration files.
For example, if you have a virtual host named `app.example.com`, you could provide a custom configuration for that host as follows:
$ docker run -d -p 80:80 -p 443:443 -v /path/to/vhost.d:/etc/nginx/vhost.d:ro -v /var/run/docker.sock:/tmp/docker.sock:ro jwilder/nginx-proxy
$ { echo 'server_tokens off;'; echo 'client_max_body_size 100m;'; } > /path/to/vhost.d/app.example.com
If you are using multiple hostnames for a single container (e.g. `VIRTUAL_HOST=example.com,www.example.com`), the virtual host configuration file must exist for each hostname. If you would like to use the same configuration for multiple virtual host names, you can use a symlink:
$ { echo 'server_tokens off;'; echo 'client_max_body_size 100m;'; } > /path/to/vhost.d/www.example.com
$ ln -s /path/to/vhost.d/www.example.com /path/to/vhost.d/example.com
#### Per-VIRTUAL_HOST default configuration
If you want most of your virtual hosts to use a default single configuration and then override on a few specific ones, add those settings to the `/etc/nginx/vhost.d/default` file. This file
will be used on any virtual host which does not have a `/etc/nginx/vhost.d/{VIRTUAL_HOST}` file associated with it.
#### Per-VIRTUAL_HOST location configuration
To add settings to the "location" block on a per-`VIRTUAL_HOST` basis, add your configuration file under `/etc/nginx/vhost.d`
just like the previous section except with the suffix `_location`.
For example, if you have a virtual host named `app.example.com` and you have configured a proxy_cache `my-cache` in another custom file, you could tell it to use a proxy cache as follows:
$ docker run -d -p 80:80 -p 443:443 -v /path/to/vhost.d:/etc/nginx/vhost.d:ro -v /var/run/docker.sock:/tmp/docker.sock:ro jwilder/nginx-proxy
$ { echo 'proxy_cache my-cache;'; echo 'proxy_cache_valid 200 302 60m;'; echo 'proxy_cache_valid 404 1m;' } > /path/to/vhost.d/app.example.com_location
If you are using multiple hostnames for a single container (e.g. `VIRTUAL_HOST=example.com,www.example.com`), the virtual host configuration file must exist for each hostname. If you would like to use the same configuration for multiple virtual host names, you can use a symlink:
$ { echo 'proxy_cache my-cache;'; echo 'proxy_cache_valid 200 302 60m;'; echo 'proxy_cache_valid 404 1m;' } > /path/to/vhost.d/app.example.com_location
$ ln -s /path/to/vhost.d/www.example.com /path/to/vhost.d/example.com
#### Per-VIRTUAL_HOST location default configuration
If you want most of your virtual hosts to use a default single `location` block configuration and then override on a few specific ones, add those settings to the `/etc/nginx/vhost.d/default_location` file. This file
will be used on any virtual host which does not have a `/etc/nginx/vhost.d/{VIRTUAL_HOST}` file associated with it.
### Contributing
Before submitting pull requests or issues, please check github to make sure an existing issue or pull request is not already open.
#### Running Tests Locally
To run tests, you'll need to install [bats 0.4.0](https://github.com/sstephenson/bats).
make test
[![GoLand logo](https://resources.jetbrains.com/storage/products/company/brand/logos/GoLand_icon.svg)](https://www.jetbrains.com/go/)
[![PyCharm logo](https://resources.jetbrains.com/storage/products/company/brand/logos/PyCharm_icon.svg)](https://www.jetbrains.com/pycharm/)

View File

@ -1,2 +1,2 @@
nginx: nginx
dockergen: docker-gen -watch -notify "nginx -s reload" /app/nginx.tmpl /etc/nginx/conf.d/default.conf
nginx: nginx -g "daemon off;"

View File

@ -0,0 +1,8 @@
-----BEGIN DH PARAMETERS-----
MIIBCAKCAQEA//////////+t+FRYortKmq/cViAnPTzx2LnFg84tNpWp4TZBFGQz
+8yTnc4kmz75fS/jY2MMddj2gbICrsRhetPfHtXV/WVhJDP1H18GbtCFY2VVPe0a
87VXE15/V8k1mE8McODmi3fipona8+/och3xWKE2rec1MKzKT0g6eXq8CrGCsyT7
YdEIqUuyyOP7uWrat2DX9GgdT0Kj3jlN9K5W7edjcrsZCwenyO4KbXCeAvzhzffi
7MA0BM0oNC9hkXL+nOmFg/+OTxIy7vKBg8P+OxtMb61zO7X8vC7CIAXFjvGDfRaD
ssbzSibBsu/6iGtCOGEoXJf//////////wIBAg==
-----END DH PARAMETERS-----

11
app/dhparam/ffdhe3072.pem Normal file
View File

@ -0,0 +1,11 @@
-----BEGIN DH PARAMETERS-----
MIIBiAKCAYEA//////////+t+FRYortKmq/cViAnPTzx2LnFg84tNpWp4TZBFGQz
+8yTnc4kmz75fS/jY2MMddj2gbICrsRhetPfHtXV/WVhJDP1H18GbtCFY2VVPe0a
87VXE15/V8k1mE8McODmi3fipona8+/och3xWKE2rec1MKzKT0g6eXq8CrGCsyT7
YdEIqUuyyOP7uWrat2DX9GgdT0Kj3jlN9K5W7edjcrsZCwenyO4KbXCeAvzhzffi
7MA0BM0oNC9hkXL+nOmFg/+OTxIy7vKBg8P+OxtMb61zO7X8vC7CIAXFjvGDfRaD
ssbzSibBsu/6iGtCOGEfz9zeNVs7ZRkDW7w09N75nAI4YbRvydbmyQd62R0mkff3
7lmMsPrBhtkcrv4TCYUTknC0EwyTvEN5RPT9RFLi103TZPLiHnH1S/9croKrnJ32
nuhtK8UiNjoNq8Uhl5sN6todv5pC1cRITgq80Gv6U93vPBsg7j/VnXwl5B0rZsYu
N///////////AgEC
-----END DH PARAMETERS-----

13
app/dhparam/ffdhe4096.pem Normal file
View File

@ -0,0 +1,13 @@
-----BEGIN DH PARAMETERS-----
MIICCAKCAgEA//////////+t+FRYortKmq/cViAnPTzx2LnFg84tNpWp4TZBFGQz
+8yTnc4kmz75fS/jY2MMddj2gbICrsRhetPfHtXV/WVhJDP1H18GbtCFY2VVPe0a
87VXE15/V8k1mE8McODmi3fipona8+/och3xWKE2rec1MKzKT0g6eXq8CrGCsyT7
YdEIqUuyyOP7uWrat2DX9GgdT0Kj3jlN9K5W7edjcrsZCwenyO4KbXCeAvzhzffi
7MA0BM0oNC9hkXL+nOmFg/+OTxIy7vKBg8P+OxtMb61zO7X8vC7CIAXFjvGDfRaD
ssbzSibBsu/6iGtCOGEfz9zeNVs7ZRkDW7w09N75nAI4YbRvydbmyQd62R0mkff3
7lmMsPrBhtkcrv4TCYUTknC0EwyTvEN5RPT9RFLi103TZPLiHnH1S/9croKrnJ32
nuhtK8UiNjoNq8Uhl5sN6todv5pC1cRITgq80Gv6U93vPBsg7j/VnXwl5B0rZp4e
8W5vUsMWTfT7eTDp5OWIV7asfV9C1p9tGHdjzx1VA0AEh/VbpX4xzHpxNciG77Qx
iu1qHgEtnmgyqQdgCpGBMMRtx3j5ca0AOAkpmaMzy4t6Gh25PXFAADwqTs6p+Y0K
zAqCkc3OyX3Pjsm1Wn+IpGtNtahR9EGC4caKAH5eZV9q//////////8CAQI=
-----END DH PARAMETERS-----

121
app/docker-entrypoint.sh Executable file
View File

@ -0,0 +1,121 @@
#!/bin/bash
set -e
function _parse_true() {
case "$1" in
true | True | TRUE | 1)
return 0
;;
*)
return 1
;;
esac
}
function _parse_false() {
case "$1" in
false | False | FALSE | 0)
return 0
;;
*)
return 1
;;
esac
}
function _print_version {
if [[ -n "${NGINX_PROXY_VERSION:-}" ]]; then
echo "Info: running nginx-proxy version ${NGINX_PROXY_VERSION}"
fi
}
function _check_unix_socket() {
# Warn if the DOCKER_HOST socket does not exist
if [[ ${DOCKER_HOST} == unix://* ]]; then
local SOCKET_FILE="${DOCKER_HOST#unix://}"
if [[ ! -S ${SOCKET_FILE} ]]; then
cat >&2 <<-EOT
ERROR: you need to share your Docker host socket with a volume at ${SOCKET_FILE}
Typically you should run your nginxproxy/nginx-proxy with: \`-v /var/run/docker.sock:${SOCKET_FILE}:ro\`
See the documentation at: https://github.com/nginx-proxy/nginx-proxy/#usage
EOT
exit 1
fi
fi
}
function _resolvers() {
# Compute the DNS resolvers for use in the templates - if the IP contains ":", it's IPv6 and must be enclosed in []
RESOLVERS=$(awk '$1 == "nameserver" {print ($2 ~ ":")? "["$2"]": $2}' ORS=' ' /etc/resolv.conf | sed 's/ *$//g'); export RESOLVERS
SCOPED_IPV6_REGEX='\[fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}\]'
if [[ -z ${RESOLVERS} ]]; then
echo 'Warning: unable to determine DNS resolvers for nginx' >&2
unset RESOLVERS
elif [[ ${RESOLVERS} =~ ${SCOPED_IPV6_REGEX} ]]; then
echo -n 'Warning: Scoped IPv6 addresses removed from resolvers: ' >&2
echo "${RESOLVERS}" | grep -Eo "$SCOPED_IPV6_REGEX" | paste -s -d ' ' >&2
RESOLVERS=$(echo "${RESOLVERS}" | sed -r "s/${SCOPED_IPV6_REGEX}//g" | xargs echo -n); export RESOLVERS
fi
}
function _setup_dhparam() {
# DH params will be supplied for nginx here:
local DHPARAM_FILE='/etc/nginx/dhparam/dhparam.pem'
# Should be 2048, 3072, or 4096 (default):
local FFDHE_GROUP="${DHPARAM_BITS:=4096}"
# DH params may be provided by the user (rarely necessary)
if [[ -f ${DHPARAM_FILE} ]]; then
echo 'Warning: A custom dhparam.pem file was provided. Best practice is to use standardized RFC7919 DHE groups instead.' >&2
return 0
elif _parse_true "${DHPARAM_SKIP:=false}"; then
echo 'Skipping Diffie-Hellman parameters setup.'
return 0
elif _parse_false "${DHPARAM_GENERATION:=true}"; then
echo 'Warning: The DHPARAM_GENERATION environment variable is deprecated, please consider using DHPARAM_SKIP set to true instead.' >&2
echo 'Skipping Diffie-Hellman parameters setup.'
return 0
elif [[ ! ${DHPARAM_BITS} =~ ^(2048|3072|4096)$ ]]; then
echo "ERROR: Unsupported DHPARAM_BITS size: ${DHPARAM_BITS}. Use: 2048, 3072, or 4096 (default)." >&2
exit 1
fi
echo 'Setting up DH Parameters..'
# Use an existing pre-generated DH group from RFC7919 (https://datatracker.ietf.org/doc/html/rfc7919#appendix-A):
local RFC7919_DHPARAM_FILE="/app/dhparam/ffdhe${FFDHE_GROUP}.pem"
# Provide the DH params file to nginx:
cp "${RFC7919_DHPARAM_FILE}" "${DHPARAM_FILE}"
}
# Run the init logic if the default CMD was provided
if [[ $* == 'forego start -r' ]]; then
_print_version
_check_unix_socket
_resolvers
_setup_dhparam
if [ -z "${TRUST_DOWNSTREAM_PROXY}" ]; then
cat >&2 <<-EOT
Warning: TRUST_DOWNSTREAM_PROXY is not set; defaulting to "true". For security, you should explicitly set TRUST_DOWNSTREAM_PROXY to "false" if there is not a trusted reverse proxy in front of this proxy.
Warning: The default value of TRUST_DOWNSTREAM_PROXY might change to "false" in a future version of nginx-proxy. If you require TRUST_DOWNSTREAM_PROXY to be enabled, explicitly set it to "true".
EOT
fi
fi
exec "$@"

View File

@ -1,4 +1,6 @@
version: '2'
volumes:
nginx_conf:
services:
nginx:
image: nginx
@ -6,18 +8,17 @@ services:
ports:
- "80:80"
volumes:
- /etc/nginx/conf.d
- nginx_conf:/etc/nginx/conf.d:ro
dockergen:
image: jwilder/docker-gen
image: nginxproxy/docker-gen
command: -notify-sighup nginx -watch /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
volumes_from:
- nginx
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl
- nginx_conf:/etc/nginx/conf.d
whoami:
image: jwilder/whoami
environment:
- VIRTUAL_HOST=whoami.local
- VIRTUAL_HOST=whoami.example

View File

@ -1,15 +1,16 @@
version: '2'
services:
nginx-proxy:
image: jwilder/nginx-proxy
image: nginxproxy/nginx-proxy
container_name: nginx-proxy
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
# if you want to proxy based on host ports, you'll want to use the host network
# network_mode: "host"
whoami:
image: jwilder/whoami
environment:
- VIRTUAL_HOST=whoami.local
- VIRTUAL_HOST=whoami.example

View File

@ -1,22 +0,0 @@
#!/bin/bash
set -e
# Warn if the DOCKER_HOST socket does not exist
if [[ $DOCKER_HOST == unix://* ]]; then
socket_file=${DOCKER_HOST#unix://}
if ! [ -S $socket_file ]; then
cat >&2 <<-EOT
ERROR: you need to share your Docker host socket with a volume at $socket_file
Typically you should run your jwilder/nginx-proxy with: \`-v /var/run/docker.sock:$socket_file:ro\`
See the documentation at http://git.io/vZaGJ
EOT
socketMissing=1
fi
fi
# If the user has run the default command and the socket doesn't exist, fail
if [ "$socketMissing" = 1 -a "$1" = forego -a "$2" = start -a "$3" = '-r' ]; then
exit 1
fi
exec "$@"

1353
docs/README.md Normal file

File diff suppressed because it is too large Load Diff

7
network_internal.conf Normal file
View File

@ -0,0 +1,7 @@
# Only allow traffic from internal clients
allow 127.0.0.0/8;
allow 10.0.0.0/8;
allow 192.168.0.0/16;
allow 172.16.0.0/12;
allow fc00::/7; # IPv6 local address range
deny all;

1224
nginx.tmpl

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,143 @@
Test suite
==========
Nginx proxy test suite
======================
This test suite is implemented on top of the [Bats](https://github.com/sstephenson/bats/blob/master/README.md) test framework.
Install requirements
--------------------
It is intended to verify the correct behavior of the Docker image `jwilder/nginx-proxy:bats`.
You need [Docker Compose v2](https://docs.docker.com/compose/install/linux/), [python 3.9](https://www.python.org/) and [pip](https://pip.pypa.io/en/stable/installation/) installed. Then run the commands:
Running the test suite
----------------------
pip install -r requirements/python-requirements.txt
Make sure you have Bats installed, then run:
Prepare the nginx-proxy test image
----------------------------------
docker build -t jwilder/nginx-proxy:bats .
bats test/
make build-nginx-proxy-test-debian
or if you want to test the alpine flavor:
make build-nginx-proxy-test-alpine
Run the test suite
------------------
pytest
need more verbosity ?
pytest -s
Note: By default this test suite relies on Docker Compose v2 with the command `docker compose`. It still supports Docker Compose v1 via the `DOCKER_COMPOSE` environment variable:
DOCKER_COMPOSE=docker-compose pytest
Run one single test module
--------------------------
pytest test_nominal.py
Run the test suite from a Docker container
------------------------------------------
If you cannot (or don't want to) install pytest and its requirements on your computer. You can use the nginx-proxy-tester docker image to run the test suite from a Docker container.
make test-debian
or if you want to test the alpine flavor:
make test-alpine
Write a test module
-------------------
This test suite uses [pytest](http://doc.pytest.org/en/latest/). The [conftest.py](conftest.py) file will be automatically loaded by pytest and will provide you with two useful pytest [fixtures](https://docs.pytest.org/en/latest/explanation/fixtures.html):
- docker_compose
- nginxproxy
### docker_compose fixture
When using the `docker_compose` fixture in a test, pytest will try to start the [Docker Compose](https://docs.docker.com/compose/) services corresponding to the current test module, based on the test module filename.
By default, if your test module file is `test/test_subdir/test_example.py`, then the `docker_compose` fixture will try to load the following files, [merging them](https://docs.docker.com/reference/compose-file/merge/) in this order:
1. `test/compose.base.yml`
2. `test/test_subdir/compose.base.override.yml` (if it exists)
3. `test/test_subdir/test_example.yml`
The fixture will run the _docker compose_ command with the `-f` option to load the given compose files. So you can test your docker compose file syntax by running it yourself with:
docker compose -f test/compose.base.yml -f test/test_subdir/test_example.yml up -d
The first file contains the base configuration of the nginx-proxy container common to most tests:
```yaml
services:
nginx-proxy:
image: nginxproxy/nginx-proxy:test
container_name: nginx-proxy
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
ports:
- "80:80"
- "443:443"
```
The second optional file allow you to override this base configuration for all test modules in a subfolder.
The third file contains the services and overrides specific to a given test module.
This automatic merge can be bypassed by using a file named `test_example.base.yml` (instead of `test_example.yml`). When this file exist, it will be the only one used by the test and no merge with other compose files will automatically occur.
The `docker_compose` fixture also set the `PYTEST_MODULE_PATH` environment variable to the absolute path of the current test module directory, so it can be used to mount files or directory relatives to the current test.
In the case you are running pytest from within a docker container, the `docker_compose` fixture will make sure the container running pytest is attached to all docker networks. That way, your test will be able to reach any of them.
In your tests, you can use the `docker_compose` variable to query and command the docker daemon as it provides you with a [client from the docker python module](https://docker-py.readthedocs.io/en/4.4.4/client.html#client-reference).
Also this fixture alters the way the python interpreter resolves domain names to IP addresses in the following ways:
Any domain name containing the substring `nginx-proxy` will resolve to `127.0.0.1` if the tests are executed on a Darwin (macOS) system, otherwise the IP address of the container that was created from the `nginxproxy/nginx-proxy:test` image.
So, in tests, all the following domain names will resolve to either localhost or the nginx-proxy container's IP:
- `nginx-proxy`
- `nginx-proxy.com`
- `www.nginx-proxy.com`
- `www.nginx-proxy.test`
- `www.nginx-proxy`
- `whatever.nginx-proxyooooooo`
- ...
Any domain name ending with `XXX.container.docker` will resolve to `127.0.0.1` if the tests are executed on a Darwin (macOS) system, otherwise the IP address of the container named `XXX`.
So, on a non-Darwin system:
- `web1.container.docker` will resolve to the IP address of the `web1` container
- `f00.web1.container.docker` will resolve to the IP address of the `web1` container
- `anything.whatever.web2.container.docker` will resolve to the IP address of the `web2` container
Otherwise, domain names are resoved as usual using your system DNS resolver.
### nginxproxy fixture
The `nginxproxy` fixture will provide you with a replacement for the python [requests](https://pypi.python.org/pypi/requests/) module. This replacement will just repeat up to 30 times a requests if it receives the HTTP error 404 or 502. This error occurs when you try to send queries to nginx-proxy too early after the container creation.
Also this requests replacement is preconfigured to use the Certificate Authority root certificate [certs/ca-root.crt](certs/) to validate https connections.
Furthermore, the nginxproxy methods accept an additional keyword parameter: `ipv6` which forces requests made against containers to use the containers IPv6 address when set to `True`. If IPv6 is not supported by the system or docker, that particular test will be skipped.
def test_forwards_to_web1_ipv6(docker_compose, nginxproxy):
r = nginxproxy.get("http://web1.nginx-proxy.tld/port", ipv6=True)
assert r.status_code == 200
assert r.text == "answer from port 81\n"
### The web docker image
When you run the `make build-webserver` command, you built a [`web`](requirements/README.md) docker image which is convenient for running a small web server in a container. This image can produce containers that listens on multiple ports at the same time.
### Testing TLS
If you need to create server certificates, use the [`certs/create_server_certificate.sh`](certs/) script. Pytest will be able to validate any certificate issued from this script.

81
test/certs/README.md Normal file
View File

@ -0,0 +1,81 @@
create_server_certificate.sh
============================
`create_server_certificate.sh` is a script helping with issuing server certificates that can be used to provide TLS on web servers.
It also creates a Certificate Authority (CA) root key and certificate. This CA root certificate can be used to validate the server certificates it generates.
For instance, with _curl_:
curl --cacert /somewhere/ca-root.crt https://www.example.com/
or with _wget_:
wget --certificate=/somewhere/ca-root.crt https://www.example.com/
or with the python _requests_ module:
import requests
r = requests.get("https://www.example.com", verify="/somewhere/ca-root.crt")
Usage
-----
### Simple domain
Create a server certificate for domain `www.example.com`:
./create_server_certificate.sh www.example.com
Will produce:
- `www.example.com.key`
- `www.example.com.crt`
### Multiple domains
Create a server certificate for main domain `www.example.com` and alternative domains `example.com`, `foo.com` and `bar.com`:
./create_server_certificate.sh www.example.com foo.com bar.com
Will produce:
- `www.example.com.key`
- `www.example.com.crt`
### Wildcard domain
Create a server certificate for wildcard domain `*.example.com`:
./create_server_certificate.sh "*.example.com"
Note that you need to use quotes around the domain string or the shell would expand `*`.
Will produce:
- `*.example.com.key`
- `*.example.com.crt`
Again, to prevent your shell from expanding `*`, use quotes. i.e.: `cat "*.example.com.crt"`.
Such a server certificate would be valid for domains:
- `foo.example.com`
- `bar.example.com`
but not for domains:
- `example.com`
- `foo.bar.example.com`
### Wildcard domain on multiple levels
While you can technically create a server certificate for wildcard domain `*.example.com` and alternative name `*.*.example.com`, client implementations generally do not support multiple wildcards in a domain name.
For instance, a python script using urllib3 would fail to validate domain `foo.bar.example.com` presenting a certificate with name `*.*.example.com`. It is advised to stay away from producing such certificates.
If you want to give it a try:
./create_server_certificate.sh "*.example.com" "*.*.example.com"
Such a server certificate would be valid for domains:
- `foo.example.com`
- `bar.example.com`
- `foo.bar.example.com`

21
test/certs/ca-root.crt Normal file
View File

@ -0,0 +1,21 @@
-----BEGIN CERTIFICATE-----
MIIDZDCCAkygAwIBAgIJAJmW6Ju6iJNNMA0GCSqGSIb3DQEBCwUAMD8xHzAdBgNV
BAoMFm5naW54LXByb3h5IHRlc3Qgc3VpdGUxHDAaBgNVBAMME3d3dy5uZ2lueC1w
cm94eS50bGQwHhcNMTcwMTEwMDAwODUxWhcNMjcwMTA4MDAwODUxWjA/MR8wHQYD
VQQKDBZuZ2lueC1wcm94eSB0ZXN0IHN1aXRlMRwwGgYDVQQDDBN3d3cubmdpbngt
cHJveHkudGxkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAndjE3OPr
48hIOQigk/HejrowsQDLNfkkc6vej0J983rJitGTgBfxqq27fOPfqhE5bi1M5JDk
KkrOrSitxCJLgpq+4Ls9/RXg8skZFHRAQbNwuKBehaDkPdamJ0i3dv6e4kZy41oI
RqxQ/MKdminC4LShFZvPoKeh9ae7w1MgB2/4E68LO66bYiHlLNL7ENViSHhLyCmt
qIE7kdV9jgn2NuVJ37m6/6SNQ3GBiIjEW+ooRQ3HEVKBCismcwq80+BD5VS/yW18
KqX8m4sBM+IgZbcOqrV+APMbGvd8iNJgQSSQC/r0Wscgt7UeggVYKDazjDSPvLUE
FUN5wEmydkP2AQIDAQABo2MwYTAdBgNVHQ4EFgQUJL59pHomt+8dUNxv8HgrYjKf
OA8wHwYDVR0jBBgwFoAUJL59pHomt+8dUNxv8HgrYjKfOA8wDwYDVR0TAQH/BAUw
AwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQADggEBABALxY96YqsZ
CL2crzY0FIGhfjLE7P3mtUGklUpFu7xyI6mGUyL1nJYSnHB5IEV6QLhVVUE/CojI
crXorQWBDkx26AgCt/eIOdvPYC0JDeXiIhH6sld3yH7JGwGqJkfXaUUfUkuwMae7
mMIEG9e6vfSh/YNTRxs0KBjBcXHHl5K+Dz4h9r14OqnQFqVFZaR6T6td44tDDNhn
beW8iIfCWRqDsnvIcJzLa2QR4onmJSw5DaSeFFaKefhdHEzEBZntLfyFbjRYHT/O
+BRdewhg6rSDkGLcL8n/ZnRLOa+xmegjQ/Op94OmWO3TfXOITJAtkaO2YVZoyek8
T6ckVovq4zU=
-----END CERTIFICATE-----

27
test/certs/ca-root.key Normal file
View File

@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEAndjE3OPr48hIOQigk/HejrowsQDLNfkkc6vej0J983rJitGT
gBfxqq27fOPfqhE5bi1M5JDkKkrOrSitxCJLgpq+4Ls9/RXg8skZFHRAQbNwuKBe
haDkPdamJ0i3dv6e4kZy41oIRqxQ/MKdminC4LShFZvPoKeh9ae7w1MgB2/4E68L
O66bYiHlLNL7ENViSHhLyCmtqIE7kdV9jgn2NuVJ37m6/6SNQ3GBiIjEW+ooRQ3H
EVKBCismcwq80+BD5VS/yW18KqX8m4sBM+IgZbcOqrV+APMbGvd8iNJgQSSQC/r0
Wscgt7UeggVYKDazjDSPvLUEFUN5wEmydkP2AQIDAQABAoIBAQCDM4zetix6lx1B
GuSuVFrTc/vJBInkgQRFiVRi67fZS/R+CJl73WsonWO7+YUNzWdZJxpE2hJs/OUx
lSBqaL8u/gUuszRhS3BBHdpU4BQRCF/ndpVaqVNN+z78ZDrrE9Vo63nPdCRw6gYf
MnzhiVjMghdq6Kn6NZwvno45WrzCsIbrrQ4zU+S2PhG8MTA53jzqqQ8mUSJX0lAl
6b9+1aWA0d0Jnk3M3doaFU/Dlnz3n6kkx0AdqNe8bdsFrPfwsrF+dwGx04SGgLmK
V2OjIDFYYGtiHp3PJ9IYIA32ij+UloSDDZ2BxXkma8Zilw04ytY5l8tlk2ZDWTD9
U2MXxjmBAoGBAMmmI19I/asTPjljlqzrOsrdRkklJvnCHgy/yw9u3nMfkJ0lLGAp
mZoCqJIEsAqlLGM5bOjKy3KQ3n2SBX3mz7/RajnpJRTnNLeJIPAAXHN9TDyKcWRo
Los6xHN7YMSLYKs4HMihXp9Yu4Ms88/8nO/01nufjN0rTgFnWdL0WfxJAoGBAMhk
Qm92ukMmbrXSrV0WF+eFooHwgPmUWZ1oZY5ZHmO3FCuSBHiICGrWKmdbcG6H5zmZ
oFZ0unsvk2Yjl+/+tntxr/dwp6Q+chsqkLms8GE76NWEO8qn4hQNywkFgpKlPci3
n5IqpuQ2DpJ1PAQkwgZD/5rSscNidNMezXO5Uvv5AoGBALR291kjXcJpKlr6AbMn
oipD9c8obMVBMNuAGh7pvjORoD7DMf+tu0XV8z8a6uHcCOmUTx/XvlP9yuDeegO/
OVYV+NdzDDi04r0PAGdKK3NAQ6Y60Fhn1J/OLFqdpHDBu/X/9eKoaKJ7KvWumVUe
YuVtXTauB8c4JkujTwQ4ov/hAoGAHxvhbGhkFhSbT0K7gx3w7BJE3iM2AojTOKqC
SYzwOM6tJO5wHz4PAHbq8kyxsZcLgFenGoTYhlMmcM7JwYorThKiHKmyfL7s++ap
vQlp785bIPp8RcO2RyK1CFuAn79jTgujjA9vBTKXJIlqncIPFOXtgl1/FzPrqvK3
NmXoyhECgYEAje9hM9RYO0jbfmTZoQh+onMRz34SM9XWLH+NQGgfvsGtjeRnrUKK
GuWQz/GQGJLy/Uc1KHIdrfPDjvQhZXmPL1v7pNfCrqyj+EnKCNDPPnYq5Zq4WLsB
x1hKPH0LmfEBkXOiFGrD3h3KAuBK5nb0/EFBDR4JuMaySC5CpbOds9o=
-----END RSA PRIVATE KEY-----

View File

@ -0,0 +1,183 @@
#!/bin/bash
set -u
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [[ "$#" -eq 0 ]]; then
cat <<-EOF
To generate a server certificate, provide the domain name as a parameter:
$(basename $0) www.my-domain.tdl
$(basename $0) www.my-domain.tdl alternate.domain.tld
You can also create certificates for wildcard domains:
$(basename $0) '*.my-domain.tdl'
EOF
exit 0
else
DOMAIN="$1"
ALTERNATE_DOMAINS="DNS:$( echo "$@" | sed 's/ /,DNS:/g')"
fi
###############################################################################
# Create a nginx container (which conveniently provides the `openssl` command)
###############################################################################
CONTAINER=$(docker run -d -v $DIR:/work -w /work -e SAN="$ALTERNATE_DOMAINS" nginx:1.27.3)
# Configure openssl
docker exec $CONTAINER bash -c '
mkdir -p /ca/{certs,crl,private,newcerts} 2>/dev/null
echo 1000 > /ca/serial
touch /ca/index.txt
cat > /ca/openssl.cnf <<-"OESCRIPT"
[ ca ]
# `man ca`
default_ca = CA_default
[ CA_default ]
# Directory and file locations.
dir = /ca
certs = $dir/certs
crl_dir = $dir/crl
new_certs_dir = $dir/newcerts
database = $dir/index.txt
serial = $dir/serial
RANDFILE = $dir/private/.rand
# The root key and root certificate.
private_key = /work/ca-root.key
certificate = /work/ca-root.crt
# SHA-1 is deprecated, so use SHA-2 instead.
default_md = sha256
name_opt = ca_default
cert_opt = ca_default
default_days = 10000
preserve = no
policy = policy_loose
[ policy_loose ]
countryName = optional
stateOrProvinceName = optional
localityName = optional
organizationName = optional
organizationalUnitName = optional
commonName = supplied
emailAddress = optional
[ req ]
# Options for the `req` tool (`man req`).
default_bits = 2048
distinguished_name = req_distinguished_name
string_mask = utf8only
# SHA-1 is deprecated, so use SHA-2 instead.
default_md = sha256
# Extension to add when the -x509 option is used.
x509_extensions = v3_ca
[ req_distinguished_name ]
# See <https://en.wikipedia.org/wiki/Certificate_signing_request>.
countryName = Country Name (2 letter code)
stateOrProvinceName = State or Province Name
localityName = Locality Name
0.organizationName = Organization Name
organizationalUnitName = Organizational Unit Name
commonName = Common Name
emailAddress = Email Address
[ v3_ca ]
# Extensions for a typical CA (`man x509v3_config`).
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer
basicConstraints = critical, CA:true
keyUsage = critical, digitalSignature, cRLSign, keyCertSign
[ server_cert ]
# Extensions for server certificates (`man x509v3_config`).
basicConstraints = CA:FALSE
nsCertType = server
nsComment = server certificate generated for test purpose (nginx-proxy test suite)
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer:always
keyUsage = critical, digitalSignature, keyEncipherment
extendedKeyUsage = serverAuth
[ san_env ]
subjectAltName=${ENV::SAN}
OESCRIPT
'
# shortcut for calling `openssl` inside the container
function openssl {
docker exec $CONTAINER openssl "$@"
}
function exitfail {
echo
echo ERROR: "$@"
docker rm -f $CONTAINER
exit 1
}
###############################################################################
# Setup Certificate authority
###############################################################################
if ! [[ -f "$DIR/ca-root.key" ]]; then
echo
echo "> Create a Certificate Authority root key: $DIR/ca-root.key"
openssl genrsa -out ca-root.key 2048
[[ $? -eq 0 ]] || exitfail failed to generate CA root key
fi
# Create a CA root certificate
if ! [[ -f "$DIR/ca-root.crt" ]]; then
echo
echo "> Create a CA root certificate: $DIR/ca-root.crt"
openssl req -config /ca/openssl.cnf \
-key ca-root.key \
-new -x509 -days 3650 -subj "/O=nginx-proxy test suite/CN=www.nginx-proxy.tld" -extensions v3_ca \
-out ca-root.crt
[[ $? -eq 0 ]] || exitfail failed to generate CA root certificate
# Verify certificate
openssl x509 -noout -text -in ca-root.crt
fi
###############################################################################
# create server key and certificate signed by the certificate authority
###############################################################################
echo
echo "> Create a host key: $DIR/$DOMAIN.key"
openssl genrsa -out "$DOMAIN.key" 2048
echo
echo "> Create a host certificate signing request"
SAN="$ALTERNATE_DOMAINS" openssl req -config /ca/openssl.cnf \
-key "$DOMAIN.key" \
-new -out "/ca/$DOMAIN.csr" -days 1000 -extensions san_env -subj "/CN=$DOMAIN"
[[ $? -eq 0 ]] || exitfail failed to generate server certificate signing request
echo
echo "> Create server certificate: $DIR/$DOMAIN.crt"
SAN="$ALTERNATE_DOMAINS" openssl ca -config /ca/openssl.cnf -batch \
-extensions server_cert \
-extensions san_env \
-in "/ca/$DOMAIN.csr" \
-out "$DOMAIN.crt"
[[ $? -eq 0 ]] || exitfail failed to generate server certificate
# Verify host certificate
#openssl x509 -noout -text -in "$DOMAIN.crt"
docker rm -f $CONTAINER >/dev/null

9
test/compose.base.yml Normal file
View File

@ -0,0 +1,9 @@
services:
nginx-proxy:
image: nginxproxy/nginx-proxy:test
container_name: nginx-proxy
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
ports:
- "80:80"
- "443:443"

620
test/conftest.py Normal file
View File

@ -0,0 +1,620 @@
import contextlib
import logging
import os
import pathlib
import platform
import re
import shlex
import socket
import subprocess
import time
from io import StringIO
from typing import Iterator, List, Optional
import backoff
import docker.errors
import pytest
import requests
from _pytest.fixtures import FixtureRequest
from docker import DockerClient
from docker.models.containers import Container
from docker.models.networks import Network
from packaging.version import Version
from requests import Response
from urllib3.util.connection import HAS_IPV6
logging.basicConfig(level=logging.INFO)
logging.getLogger('backoff').setLevel(logging.INFO)
logging.getLogger('DNS').setLevel(logging.DEBUG)
logging.getLogger('requests.packages.urllib3.connectionpool').setLevel(logging.WARN)
CA_ROOT_CERTIFICATE = pathlib.Path(__file__).parent.joinpath("certs/ca-root.crt")
PYTEST_RUNNING_IN_CONTAINER = os.environ.get('PYTEST_RUNNING_IN_CONTAINER') == "1"
FORCE_CONTAINER_IPV6 = False # ugly global state to consider containers' IPv6 address instead of IPv4
DOCKER_COMPOSE = os.environ.get('DOCKER_COMPOSE', 'docker compose')
docker_client = docker.from_env()
# Name of pytest container to reference if it's being used for running tests
test_container = 'nginx-proxy-pytest'
###############################################################################
#
# utilities
#
###############################################################################
@contextlib.contextmanager
def ipv6(force_ipv6: bool = True):
"""
Meant to be used as a context manager to force IPv6 sockets:
with ipv6():
nginxproxy.get("http://something.nginx-proxy.example") # force use of IPv6
with ipv6(False):
nginxproxy.get("http://something.nginx-proxy.example") # legacy behavior
"""
global FORCE_CONTAINER_IPV6
FORCE_CONTAINER_IPV6 = force_ipv6
yield
FORCE_CONTAINER_IPV6 = False
class RequestsForDocker:
"""
Proxy for calling methods of the requests module.
When an HTTP response failed due to HTTP Error 404 or 502, retry a few times.
Provides method `get_conf` to extract the nginx-proxy configuration content.
"""
def __init__(self):
self.session = requests.Session()
if CA_ROOT_CERTIFICATE.is_file():
self.session.verify = CA_ROOT_CERTIFICATE.as_posix()
@staticmethod
def get_nginx_proxy_container() -> Container:
"""
Return list of containers
"""
nginx_proxy_containers = docker_client.containers.list(filters={"ancestor": "nginxproxy/nginx-proxy:test"})
if len(nginx_proxy_containers) > 1:
pytest.fail("Too many running nginxproxy/nginx-proxy:test containers", pytrace=False)
elif len(nginx_proxy_containers) == 0:
pytest.fail("No running nginxproxy/nginx-proxy:test container", pytrace=False)
return nginx_proxy_containers.pop()
def get_conf(self) -> bytes:
"""
Return the nginx config file
"""
nginx_proxy_container = self.get_nginx_proxy_container()
return get_nginx_conf_from_container(nginx_proxy_container)
def get_ip(self) -> str:
"""
Return the nginx container ip address
"""
nginx_proxy_container = self.get_nginx_proxy_container()
return container_ip(nginx_proxy_container)
def get(self, *args, **kwargs) -> Response:
with ipv6(kwargs.pop('ipv6', False)):
@backoff.on_predicate(backoff.constant, lambda r: r.status_code in (404, 502), interval=.3, max_tries=30, jitter=None)
def _get(*_args, **_kwargs):
return self.session.get(*_args, **_kwargs)
return _get(*args, **kwargs)
def post(self, *args, **kwargs) -> Response:
with ipv6(kwargs.pop('ipv6', False)):
@backoff.on_predicate(backoff.constant, lambda r: r.status_code in (404, 502), interval=.3, max_tries=30, jitter=None)
def _post(*_args, **_kwargs):
return self.session.post(*_args, **_kwargs)
return _post(*args, **kwargs)
def put(self, *args, **kwargs) -> Response:
with ipv6(kwargs.pop('ipv6', False)):
@backoff.on_predicate(backoff.constant, lambda r: r.status_code in (404, 502), interval=.3, max_tries=30, jitter=None)
def _put(*_args, **_kwargs):
return self.session.put(*_args, **_kwargs)
return _put(*args, **kwargs)
def head(self, *args, **kwargs) -> Response:
with ipv6(kwargs.pop('ipv6', False)):
@backoff.on_predicate(backoff.constant, lambda r: r.status_code in (404, 502), interval=.3, max_tries=30, jitter=None)
def _head(*_args, **_kwargs):
return self.session.head(*_args, **_kwargs)
return _head(*args, **kwargs)
def delete(self, *args, **kwargs) -> Response:
with ipv6(kwargs.pop('ipv6', False)):
@backoff.on_predicate(backoff.constant, lambda r: r.status_code in (404, 502), interval=.3, max_tries=30, jitter=None)
def _delete(*_args, **_kwargs):
return self.session.delete(*_args, **_kwargs)
return _delete(*args, **kwargs)
def options(self, *args, **kwargs) -> Response:
with ipv6(kwargs.pop('ipv6', False)):
@backoff.on_predicate(backoff.constant, lambda r: r.status_code in (404, 502), interval=.3, max_tries=30, jitter=None)
def _options(*_args, **_kwargs):
return self.session.options(*_args, **_kwargs)
return _options(*args, **kwargs)
def __getattr__(self, name):
return getattr(requests, name)
def container_ip(container: Container) -> str:
"""
return the IP address of a container.
If the global FORCE_CONTAINER_IPV6 flag is set, return the IPv6 address
"""
global FORCE_CONTAINER_IPV6
if FORCE_CONTAINER_IPV6:
if not HAS_IPV6:
pytest.skip("This system does not support IPv6")
ip = container_ipv6(container)
if ip == '':
pytest.skip(f"Container {container.name} has no IPv6 address")
else:
return ip
else:
net_info = container.attrs["NetworkSettings"]["Networks"]
if "bridge" in net_info:
return net_info["bridge"]["IPAddress"]
# container is running in host network mode
if "host" in net_info:
return "127.0.0.1"
# not default bridge network, fallback on first network defined
network_name = list(net_info.keys())[0]
return net_info[network_name]["IPAddress"]
def container_ipv6(container: Container) -> str:
"""
return the IPv6 address of a container.
"""
net_info = container.attrs["NetworkSettings"]["Networks"]
if "bridge" in net_info:
return net_info["bridge"]["GlobalIPv6Address"]
# container is running in host network mode
if "host" in net_info:
return "::1"
# not default bridge network, fallback on first network defined
network_name = list(net_info.keys())[0]
return net_info[network_name]["GlobalIPv6Address"]
def nginx_proxy_dns_resolver(domain_name: str) -> Optional[str]:
"""
if "nginx-proxy" if found in host, return the ip address of the docker container
issued from the docker image nginxproxy/nginx-proxy:test.
:return: IP or None
"""
log = logging.getLogger('DNS')
log.debug(f"nginx_proxy_dns_resolver({domain_name!r})")
if 'nginx-proxy' in domain_name:
nginxproxy_containers = docker_client.containers.list(filters={"status": "running", "ancestor": "nginxproxy/nginx-proxy:test"})
if len(nginxproxy_containers) == 0:
log.warning(f"no container found from image nginxproxy/nginx-proxy:test while resolving {domain_name!r}")
exited_nginxproxy_containers = docker_client.containers.list(filters={"status": "exited", "ancestor": "nginxproxy/nginx-proxy:test"})
if len(exited_nginxproxy_containers) > 0:
exited_nginxproxy_container_logs = exited_nginxproxy_containers[0].logs()
log.warning(f"nginxproxy/nginx-proxy:test container might have exited unexpectedly. Container logs: " + "\n" + exited_nginxproxy_container_logs.decode())
return None
nginxproxy_container = nginxproxy_containers[0]
ip = container_ip(nginxproxy_container)
log.info(f"resolving domain name {domain_name!r} as IP address {ip} of nginx-proxy container {nginxproxy_container.name}")
return ip
def docker_container_dns_resolver(domain_name: str) -> Optional[str]:
"""
if domain name is of the form "XXX.container.docker" or "anything.XXX.container.docker",
return the ip address of the docker container named XXX.
:return: IP or None
"""
log = logging.getLogger('DNS')
log.debug(f"docker_container_dns_resolver({domain_name!r})")
match = re.search(r'(^|.+\.)(?P<container>[^.]+)\.container\.docker$', domain_name)
if not match:
log.debug(f"{domain_name!r} does not match")
return None
container_name = match.group('container')
log.debug(f"looking for container {container_name!r}")
try:
container = docker_client.containers.get(container_name)
except docker.errors.NotFound:
log.warning(f"container named {container_name!r} not found while resolving {domain_name!r}")
return None
log.debug(f"container {container.name!r} found ({container.short_id})")
ip = container_ip(container)
log.info(f"resolving domain name {domain_name!r} as IP address {ip} of container {container.name}")
return ip
def monkey_patch_urllib_dns_resolver():
"""
Alter the behavior of the urllib DNS resolver so that any domain name
containing substring 'nginx-proxy' will resolve to the IP address
of the container created from image 'nginxproxy/nginx-proxy:test',
or to 127.0.0.1 on Darwin.
see https://docs.docker.com/desktop/features/networking/#i-want-to-connect-to-a-container-from-the-host
"""
prv_getaddrinfo = socket.getaddrinfo
dns_cache = {}
def new_getaddrinfo(*args):
logging.getLogger('DNS').debug(f"resolving domain name {repr(args)}")
_args = list(args)
# Fail early when querying IP directly, and it is forced ipv6 when not supported,
# Otherwise a pytest container not using the host network fails to pass `test_raw-ip-vhost`.
if FORCE_CONTAINER_IPV6 and not HAS_IPV6:
pytest.skip("This system does not support IPv6")
# custom DNS resolvers
ip = None
# Docker Desktop can't route traffic directly to Linux containers.
if platform.system() == "Darwin":
ip = "127.0.0.1"
if ip is None:
ip = nginx_proxy_dns_resolver(args[0])
if ip is None:
ip = docker_container_dns_resolver(args[0])
if ip is not None:
_args[0] = ip
# call on original DNS resolver, with eventually the original host changed to the wanted IP address
try:
return dns_cache[tuple(_args)]
except KeyError:
res = prv_getaddrinfo(*_args)
dns_cache[tuple(_args)] = res
return res
socket.getaddrinfo = new_getaddrinfo
return prv_getaddrinfo
def restore_urllib_dns_resolver(getaddrinfo_func):
socket.getaddrinfo = getaddrinfo_func
def get_nginx_conf_from_container(container: Container) -> bytes:
"""
return the nginx /etc/nginx/conf.d/default.conf file content from a container
"""
import tarfile
from io import BytesIO
strm_generator, stat = container.get_archive('/etc/nginx/conf.d/default.conf')
strm_fileobj = BytesIO(b"".join(strm_generator))
with tarfile.open(fileobj=strm_fileobj) as tf:
conffile = tf.extractfile('default.conf')
return conffile.read()
def __prepare_and_execute_compose_cmd(compose_files: List[str], project_name: str, cmd: str):
"""
Prepare and execute the Docker Compose command with the provided compose files and project name.
"""
compose_cmd = StringIO()
compose_cmd.write(DOCKER_COMPOSE)
compose_cmd.write(f" --project-name {project_name}")
for compose_file in compose_files:
compose_cmd.write(f" --file {compose_file}")
compose_cmd.write(f" {cmd}")
logging.info(compose_cmd.getvalue())
try:
subprocess.check_output(shlex.split(compose_cmd.getvalue()), stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
pytest.fail(f"Error while running '{compose_cmd.getvalue()}':\n{e.output}", pytrace=False)
def docker_compose_up(compose_files: List[str], project_name: str):
"""
Execute compose up --detach with the provided compose files and project name.
"""
if compose_files is None or len(compose_files) == 0:
pytest.fail(f"No compose file passed to docker_compose_up", pytrace=False)
__prepare_and_execute_compose_cmd(compose_files, project_name, cmd="up --detach")
def docker_compose_down(compose_files: List[str], project_name: str):
"""
Execute compose down --volumes with the provided compose files and project name.
"""
if compose_files is None or len(compose_files) == 0:
pytest.fail(f"No compose file passed to docker_compose_up", pytrace=False)
__prepare_and_execute_compose_cmd(compose_files, project_name, cmd="down --volumes")
def wait_for_nginxproxy_to_be_ready():
"""
If one (and only one) container started from image nginxproxy/nginx-proxy:test is found,
wait for its log to contain substring "Watching docker events"
"""
containers = docker_client.containers.list(filters={"ancestor": "nginxproxy/nginx-proxy:test"})
if len(containers) != 1:
return
container = containers[0]
for line in container.logs(stream=True):
if b"Watching docker events" in line:
logging.debug("nginx-proxy ready")
break
@pytest.fixture
def docker_compose_files(request: FixtureRequest) -> List[str]:
"""Fixture returning the docker compose files to consider:
If a YAML file exists with the same name as the test module (with the `.py` extension
replaced with `.base.yml`, ie `test_foo.py`-> `test_foo.base.yml`) and in the same
directory as the test module, use only that file.
Otherwise, merge the following files in this order:
- the `compose.base.yml` file in the parent `test` directory.
- if present in the same directory as the test module, the `compose.base.override.yml` file.
- the YAML file named after the current test module (ie `test_foo.py`-> `test_foo.yml`)
Tests can override this fixture to specify a custom location.
"""
compose_files: List[str] = []
test_module_path = pathlib.Path(request.module.__file__).parent
module_base_file = test_module_path.joinpath(f"{request.module.__name__}.base.yml")
if module_base_file.is_file():
return [module_base_file.as_posix()]
global_base_file = test_module_path.parent.joinpath("compose.base.yml")
if global_base_file.is_file():
compose_files.append(global_base_file.as_posix())
module_base_override_file = test_module_path.joinpath("compose.base.override.yml")
if module_base_override_file.is_file():
compose_files.append(module_base_override_file.as_posix())
module_compose_file = test_module_path.joinpath(f"{request.module.__name__}.yml")
if module_compose_file.is_file():
compose_files.append(module_compose_file.as_posix())
if not module_base_file.is_file() and not module_compose_file.is_file():
logging.error(
f"Could not find any docker compose file named '{module_base_file.name}' or '{module_compose_file.name}'"
)
logging.debug(f"using docker compose files {compose_files}")
return compose_files
def connect_to_network(network: Network) -> Optional[Network]:
"""
If we are running from a container, connect our container to the given network
:return: the name of the network we were connected to, or None
"""
if PYTEST_RUNNING_IN_CONTAINER:
try:
my_container = docker_client.containers.get(test_container)
except docker.errors.NotFound:
logging.warning(f"container {test_container} not found")
return None
# figure out our container networks
my_networks = list(my_container.attrs["NetworkSettings"]["Networks"].keys())
# If the pytest container is using host networking, it cannot connect to container networks (not required with host network)
if 'host' in my_networks:
return None
# Make sure our container is connected to the nginx-proxy's network,
# but avoid connecting to `none` network (not valid) with `test_server-down` tests
if network.name not in my_networks and network.name != 'none':
logging.info(f"Connecting to docker network: {network.name}")
network.connect(my_container)
return network
def disconnect_from_network(network: Network = None):
"""
If we are running from a container, disconnect our container from the given network.
:param network: name of a docker network to disconnect from
"""
if PYTEST_RUNNING_IN_CONTAINER and network is not None:
try:
my_container = docker_client.containers.get(test_container)
except docker.errors.NotFound:
logging.warning(f"container {test_container} not found")
return
# figure out our container networks
my_networks_names = list(my_container.attrs["NetworkSettings"]["Networks"].keys())
# disconnect our container from the given network
if network.name in my_networks_names:
logging.info(f"Disconnecting from network {network.name}")
network.disconnect(my_container)
def connect_to_all_networks() -> List[Network]:
"""
If we are running from a container, connect our container to all current docker networks.
:return: a list of networks we connected to
"""
if not PYTEST_RUNNING_IN_CONTAINER:
return []
else:
# find the list of docker networks
networks = [network for network in docker_client.networks.list(greedy=True) if len(network.containers) > 0 and network.name != 'bridge']
return [connect_to_network(network) for network in networks]
class DockerComposer(contextlib.AbstractContextManager):
def __init__(self):
self._networks = None
self._docker_compose_files = None
self._project_name = None
def __exit__(self, *exc_info):
self._down()
def _down(self):
if self._docker_compose_files is None:
return
for network in self._networks:
disconnect_from_network(network)
docker_compose_down(self._docker_compose_files, self._project_name)
self._docker_compose_file = None
self._project_name = None
def compose(self, docker_compose_files: List[str], project_name: str):
if docker_compose_files == self._docker_compose_files and project_name == self._project_name:
return
self._down()
if docker_compose_files is None or project_name is None:
return
docker_compose_up(docker_compose_files, project_name)
self._networks = connect_to_all_networks()
wait_for_nginxproxy_to_be_ready()
time.sleep(3) # give time to containers to be ready
self._docker_compose_files = docker_compose_files
self._project_name = project_name
###############################################################################
#
# Py.test fixtures
#
###############################################################################
@pytest.fixture(scope="module")
def docker_composer() -> Iterator[DockerComposer]:
with DockerComposer() as d:
yield d
@pytest.fixture
def ca_root_certificate() -> str:
return CA_ROOT_CERTIFICATE.as_posix()
@pytest.fixture
def monkey_patched_dns():
original_dns_resolver = monkey_patch_urllib_dns_resolver()
yield
restore_urllib_dns_resolver(original_dns_resolver)
@pytest.fixture
def docker_compose(
request: FixtureRequest,
monkeypatch,
monkey_patched_dns,
docker_composer,
docker_compose_files
) -> Iterator[DockerClient]:
"""
Ensures containers necessary for the test module are started in a compose project,
and set the environment variable `PYTEST_MODULE_PATH` to the test module's parent folder.
A list of custom docker compose files path can be specified by overriding
the `docker_compose_file` fixture.
Also, in the case where pytest is running from a docker container, this fixture
makes sure our container will be attached to all the docker networks.
"""
pytest_module_path = pathlib.Path(request.module.__file__).parent
monkeypatch.setenv("PYTEST_MODULE_PATH", pytest_module_path.as_posix())
project_name = request.module.__name__
docker_composer.compose(docker_compose_files, project_name)
yield docker_client
@pytest.fixture
def nginxproxy() -> Iterator[RequestsForDocker]:
"""
Provides the `nginxproxy` object that can be used in the same way the requests module is:
r = nginxproxy.get("https://foo.com")
The difference is that in case an HTTP requests has status code 404 or 502 (which mostly
indicates that nginx has just reloaded), we retry up to 30 times the query.
Also, the nginxproxy methods accept an additional keyword parameter: `ipv6` which forces requests
made against containers to use the containers IPv6 address when set to `True`. If IPv6 is not
supported by the system or docker, that particular test will be skipped.
"""
yield RequestsForDocker()
@pytest.fixture
def acme_challenge_path() -> str:
"""
Provides fake Let's Encrypt ACME challenge path used in certain tests
"""
return ".well-known/acme-challenge/test-filename"
###############################################################################
#
# Py.test hooks
#
###############################################################################
# pytest hook to display additional stuff in test report
def pytest_runtest_logreport(report):
if report.failed:
test_containers = docker_client.containers.list(all=True, filters={"ancestor": "nginxproxy/nginx-proxy:test"})
for container in test_containers:
report.longrepr.addsection('nginx-proxy logs', container.logs().decode())
report.longrepr.addsection('nginx-proxy conf', get_nginx_conf_from_container(container).decode())
# Py.test `incremental` marker, see http://stackoverflow.com/a/12579625/107049
def pytest_runtest_makereport(item, call):
if "incremental" in item.keywords:
if call.excinfo is not None:
parent = item.parent
parent._previousfailed = item
def pytest_runtest_setup(item):
previousfailed = getattr(item.parent, "_previousfailed", None)
if previousfailed is not None:
pytest.xfail(f"previous test failed ({previousfailed.name})")
###############################################################################
#
# Check requirements
#
###############################################################################
try:
docker_client.images.get('nginxproxy/nginx-proxy:test')
except docker.errors.ImageNotFound:
pytest.exit("The docker image 'nginxproxy/nginx-proxy:test' is missing")
if Version(docker.__version__) < Version("7.0.0"):
pytest.exit("This test suite is meant to work with the python docker module v7.0.0 or later")

View File

@ -1,33 +0,0 @@
#!/usr/bin/env bats
load test_helpers
function setup {
# make sure to stop any web container before each test so we don't
# have any unexpected contaiener running with VIRTUAL_HOST or VIRUTAL_PORT set
stop_bats_containers web
}
@test "[$TEST_FILE] DEFAULT_HOST=web1.bats" {
SUT_CONTAINER=bats-nginx-proxy-${TEST_FILE}-1
# GIVEN a webserver with VIRTUAL_HOST set to web.bats
prepare_web_container bats-web 80 -e VIRTUAL_HOST=web.bats
# WHEN nginx-proxy runs with DEFAULT_HOST set to web.bats
run nginxproxy $SUT_CONTAINER -v /var/run/docker.sock:/tmp/docker.sock:ro -e DEFAULT_HOST=web.bats
assert_success
docker_wait_for_log $SUT_CONTAINER 9 "Watching docker events"
# THEN querying the proxy without Host header → 200
run curl_container $SUT_CONTAINER / --head
assert_output -l 0 $'HTTP/1.1 200 OK\r'
# THEN querying the proxy with any other Host header → 200
run curl_container $SUT_CONTAINER / --head --header "Host: something.I.just.made.up"
assert_output -l 0 $'HTTP/1.1 200 OK\r'
}
@test "[$TEST_FILE] stop all bats containers" {
stop_bats_containers
}

View File

@ -1,123 +0,0 @@
#!/usr/bin/env bats
load test_helpers
@test "[$TEST_FILE] start 2 web containers" {
prepare_web_container bats-web1 81 -e VIRTUAL_HOST=web1.bats
prepare_web_container bats-web2 82 -e VIRTUAL_HOST=web2.bats
}
@test "[$TEST_FILE] -v /var/run/docker.sock:/tmp/docker.sock:ro" {
SUT_CONTAINER=bats-nginx-proxy-${TEST_FILE}-1
# WHEN nginx-proxy runs on our docker host using the default unix socket
run nginxproxy $SUT_CONTAINER -v /var/run/docker.sock:/tmp/docker.sock:ro
assert_success
docker_wait_for_log $SUT_CONTAINER 9 "Watching docker events"
# THEN
assert_nginxproxy_behaves $SUT_CONTAINER
}
@test "[$TEST_FILE] -v /var/run/docker.sock:/f00.sock:ro -e DOCKER_HOST=unix:///f00.sock" {
SUT_CONTAINER=bats-nginx-proxy-${TEST_FILE}-2
# WHEN nginx-proxy runs on our docker host using a custom unix socket
run nginxproxy $SUT_CONTAINER -v /var/run/docker.sock:/f00.sock:ro -e DOCKER_HOST=unix:///f00.sock
assert_success
docker_wait_for_log $SUT_CONTAINER 9 "Watching docker events"
# THEN
assert_nginxproxy_behaves $SUT_CONTAINER
}
@test "[$TEST_FILE] -e DOCKER_HOST=tcp://..." {
SUT_CONTAINER=bats-nginx-proxy-${TEST_FILE}-3
# GIVEN a container exposing our docker host over TCP
run docker_tcp bats-docker-tcp
assert_success
sleep 1s
# WHEN nginx-proxy runs on our docker host using tcp to connect to our docker host
run nginxproxy $SUT_CONTAINER -e DOCKER_HOST="tcp://bats-docker-tcp:2375" --link bats-docker-tcp:bats-docker-tcp
assert_success
docker_wait_for_log $SUT_CONTAINER 9 "Watching docker events"
# THEN
assert_nginxproxy_behaves $SUT_CONTAINER
}
@test "[$TEST_FILE] separated containers (nginx + docker-gen + nginx.tmpl)" {
docker_clean bats-nginx
docker_clean bats-docker-gen
# GIVEN a simple nginx container
run docker run -d \
--label bats-type="nginx" \
--name bats-nginx \
-v /etc/nginx/conf.d/ \
-v /etc/nginx/certs/ \
nginx:latest
assert_success
run retry 5 1s docker run --label bats-type="curl" appropriate/curl --silent --fail --head http://$(docker_ip bats-nginx)/
assert_output -l 0 $'HTTP/1.1 200 OK\r'
# WHEN docker-gen runs on our docker host
run docker run -d \
--label bats-type="docker-gen" \
--name bats-docker-gen \
-v /var/run/docker.sock:/tmp/docker.sock:ro \
-v $BATS_TEST_DIRNAME/../nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro \
--volumes-from bats-nginx \
--expose 80 \
jwilder/docker-gen:0.7.3 \
-notify-sighup bats-nginx \
-watch \
-only-exposed \
/etc/docker-gen/templates/nginx.tmpl \
/etc/nginx/conf.d/default.conf
assert_success
docker_wait_for_log bats-docker-gen 9 "Watching docker events"
# Give some time to the docker-gen container to notify bats-nginx so it
# reloads its config
sleep 2s
run docker_running_state bats-nginx
assert_output "true" || {
docker logs bats-docker-gen
false
} >&2
# THEN
assert_nginxproxy_behaves bats-nginx
}
@test "[$TEST_FILE] stop all bats containers" {
stop_bats_containers
}
# $1 nginx-proxy container
function assert_nginxproxy_behaves {
local -r container=$1
# Querying the proxy without Host header → 503
run curl_container $container / --head
assert_output -l 0 $'HTTP/1.1 503 Service Temporarily Unavailable\r'
# Querying the proxy with Host header → 200
run curl_container $container /data --header "Host: web1.bats"
assert_output "answer from port 81"
run curl_container $container /data --header "Host: web2.bats"
assert_output "answer from port 82"
# Querying the proxy with unknown Host header → 503
run curl_container $container /data --header "Host: webFOO.bats" --head
assert_output -l 0 $'HTTP/1.1 503 Service Temporarily Unavailable\r'
}

View File

@ -1,6 +0,0 @@
bats lib
========
found on https://github.com/sstephenson/bats/pull/110
When that pull request will be merged, the `test/lib/bats` won't be necessary anymore.

View File

@ -1,596 +0,0 @@
#
# batslib.bash
# ------------
#
# The Standard Library is a collection of test helpers intended to
# simplify testing. It contains the following types of test helpers.
#
# - Assertions are functions that perform a test and output relevant
# information on failure to help debugging. They return 1 on failure
# and 0 otherwise.
#
# All output is formatted for readability using the functions of
# `output.bash' and sent to the standard error.
#
source "${BATS_LIB}/batslib/output.bash"
########################################################################
# ASSERTIONS
########################################################################
# Fail and display a message. When no parameters are specified, the
# message is read from the standard input. Other functions use this to
# report failure.
#
# Globals:
# none
# Arguments:
# $@ - [=STDIN] message
# Returns:
# 1 - always
# Inputs:
# STDIN - [=$@] message
# Outputs:
# STDERR - message
fail() {
(( $# == 0 )) && batslib_err || batslib_err "$@"
return 1
}
# Fail and display details if the expression evaluates to false. Details
# include the expression, `$status' and `$output'.
#
# NOTE: The expression must be a simple command. Compound commands, such
# as `[[', can be used only when executed with `bash -c'.
#
# Globals:
# status
# output
# Arguments:
# $1 - expression
# Returns:
# 0 - expression evaluates to TRUE
# 1 - otherwise
# Outputs:
# STDERR - details, on failure
assert() {
if ! "$@"; then
{ local -ar single=(
'expression' "$*"
'status' "$status"
)
local -ar may_be_multi=(
'output' "$output"
)
local -ir width="$( batslib_get_max_single_line_key_width \
"${single[@]}" "${may_be_multi[@]}" )"
batslib_print_kv_single "$width" "${single[@]}"
batslib_print_kv_single_or_multi "$width" "${may_be_multi[@]}"
} | batslib_decorate 'assertion failed' \
| fail
fi
}
# Fail and display details if the expected and actual values do not
# equal. Details include both values.
#
# Globals:
# none
# Arguments:
# $1 - actual value
# $2 - expected value
# Returns:
# 0 - values equal
# 1 - otherwise
# Outputs:
# STDERR - details, on failure
assert_equal() {
if [[ $1 != "$2" ]]; then
batslib_print_kv_single_or_multi 8 \
'expected' "$2" \
'actual' "$1" \
| batslib_decorate 'values do not equal' \
| fail
fi
}
# Fail and display details if `$status' is not 0. Details include
# `$status' and `$output'.
#
# Globals:
# status
# output
# Arguments:
# none
# Returns:
# 0 - `$status' is 0
# 1 - otherwise
# Outputs:
# STDERR - details, on failure
assert_success() {
if (( status != 0 )); then
{ local -ir width=6
batslib_print_kv_single "$width" 'status' "$status"
batslib_print_kv_single_or_multi "$width" 'output' "$output"
} | batslib_decorate 'command failed' \
| fail
fi
}
# Fail and display details if `$status' is 0. Details include `$output'.
#
# Optionally, when the expected status is specified, fail when it does
# not equal `$status'. In this case, details include the expected and
# actual status, and `$output'.
#
# Globals:
# status
# output
# Arguments:
# $1 - [opt] expected status
# Returns:
# 0 - `$status' is not 0, or
# `$status' equals the expected status
# 1 - otherwise
# Outputs:
# STDERR - details, on failure
assert_failure() {
(( $# > 0 )) && local -r expected="$1"
if (( status == 0 )); then
batslib_print_kv_single_or_multi 6 'output' "$output" \
| batslib_decorate 'command succeeded, but it was expected to fail' \
| fail
elif (( $# > 0 )) && (( status != expected )); then
{ local -ir width=8
batslib_print_kv_single "$width" \
'expected' "$expected" \
'actual' "$status"
batslib_print_kv_single_or_multi "$width" \
'output' "$output"
} | batslib_decorate 'command failed as expected, but status differs' \
| fail
fi
}
# Fail and display details if the expected does not match the actual
# output or a fragment of it.
#
# By default, the entire output is matched. The assertion fails if the
# expected output does not equal `$output'. Details include both values.
#
# When `-l <index>' is used, only the <index>-th line is matched. The
# assertion fails if the expected line does not equal
# `${lines[<index>}'. Details include the compared lines and <index>.
#
# When `-l' is used without the <index> argument, the output is searched
# for the expected line. The expected line is matched against each line
# in `${lines[@]}'. If no match is found the assertion fails. Details
# include the expected line and `$output'.
#
# By default, literal matching is performed. Options `-p' and `-r'
# enable partial (i.e. substring) and extended regular expression
# matching, respectively. Specifying an invalid extended regular
# expression with `-r' displays an error.
#
# Options `-p' and `-r' are mutually exclusive. When used
# simultaneously, an error is displayed.
#
# Globals:
# output
# lines
# Options:
# -l <index> - match against the <index>-th element of `${lines[@]}'
# -l - search `${lines[@]}' for the expected line
# -p - partial matching
# -r - extended regular expression matching
# Arguments:
# $1 - expected output
# Returns:
# 0 - expected matches the actual output
# 1 - otherwise
# Outputs:
# STDERR - details, on failure
# error message, on error
assert_output() {
local -i is_match_line=0
local -i is_match_contained=0
local -i is_mode_partial=0
local -i is_mode_regex=0
# Handle options.
while (( $# > 0 )); do
case "$1" in
-l)
if (( $# > 2 )) && [[ $2 =~ ^([0-9]|[1-9][0-9]+)$ ]]; then
is_match_line=1
local -ri idx="$2"
shift
else
is_match_contained=1;
fi
shift
;;
-p) is_mode_partial=1; shift ;;
-r) is_mode_regex=1; shift ;;
--) break ;;
*) break ;;
esac
done
if (( is_match_line )) && (( is_match_contained )); then
echo "\`-l' and \`-l <index>' are mutually exclusive" \
| batslib_decorate 'ERROR: assert_output' \
| fail
return $?
fi
if (( is_mode_partial )) && (( is_mode_regex )); then
echo "\`-p' and \`-r' are mutually exclusive" \
| batslib_decorate 'ERROR: assert_output' \
| fail
return $?
fi
# Arguments.
local -r expected="$1"
if (( is_mode_regex == 1 )) && [[ '' =~ $expected ]] || (( $? == 2 )); then
echo "Invalid extended regular expression: \`$expected'" \
| batslib_decorate 'ERROR: assert_output' \
| fail
return $?
fi
# Matching.
if (( is_match_contained )); then
# Line contained in output.
if (( is_mode_regex )); then
local -i idx
for (( idx = 0; idx < ${#lines[@]}; ++idx )); do
[[ ${lines[$idx]} =~ $expected ]] && return 0
done
{ local -ar single=(
'regex' "$expected"
)
local -ar may_be_multi=(
'output' "$output"
)
local -ir width="$( batslib_get_max_single_line_key_width \
"${single[@]}" "${may_be_multi[@]}" )"
batslib_print_kv_single "$width" "${single[@]}"
batslib_print_kv_single_or_multi "$width" "${may_be_multi[@]}"
} | batslib_decorate 'no output line matches regular expression' \
| fail
elif (( is_mode_partial )); then
local -i idx
for (( idx = 0; idx < ${#lines[@]}; ++idx )); do
[[ ${lines[$idx]} == *"$expected"* ]] && return 0
done
{ local -ar single=(
'substring' "$expected"
)
local -ar may_be_multi=(
'output' "$output"
)
local -ir width="$( batslib_get_max_single_line_key_width \
"${single[@]}" "${may_be_multi[@]}" )"
batslib_print_kv_single "$width" "${single[@]}"
batslib_print_kv_single_or_multi "$width" "${may_be_multi[@]}"
} | batslib_decorate 'no output line contains substring' \
| fail
else
local -i idx
for (( idx = 0; idx < ${#lines[@]}; ++idx )); do
[[ ${lines[$idx]} == "$expected" ]] && return 0
done
{ local -ar single=(
'line' "$expected"
)
local -ar may_be_multi=(
'output' "$output"
)
local -ir width="$( batslib_get_max_single_line_key_width \
"${single[@]}" "${may_be_multi[@]}" )"
batslib_print_kv_single "$width" "${single[@]}"
batslib_print_kv_single_or_multi "$width" "${may_be_multi[@]}"
} | batslib_decorate 'output does not contain line' \
| fail
fi
elif (( is_match_line )); then
# Specific line.
if (( is_mode_regex )); then
if ! [[ ${lines[$idx]} =~ $expected ]]; then
batslib_print_kv_single 5 \
'index' "$idx" \
'regex' "$expected" \
'line' "${lines[$idx]}" \
| batslib_decorate 'regular expression does not match line' \
| fail
fi
elif (( is_mode_partial )); then
if [[ ${lines[$idx]} != *"$expected"* ]]; then
batslib_print_kv_single 9 \
'index' "$idx" \
'substring' "$expected" \
'line' "${lines[$idx]}" \
| batslib_decorate 'line does not contain substring' \
| fail
fi
else
if [[ ${lines[$idx]} != "$expected" ]]; then
batslib_print_kv_single 8 \
'index' "$idx" \
'expected' "$expected" \
'actual' "${lines[$idx]}" \
| batslib_decorate 'line differs' \
| fail
fi
fi
else
# Entire output.
if (( is_mode_regex )); then
if ! [[ $output =~ $expected ]]; then
batslib_print_kv_single_or_multi 6 \
'regex' "$expected" \
'output' "$output" \
| batslib_decorate 'regular expression does not match output' \
| fail
fi
elif (( is_mode_partial )); then
if [[ $output != *"$expected"* ]]; then
batslib_print_kv_single_or_multi 9 \
'substring' "$expected" \
'output' "$output" \
| batslib_decorate 'output does not contain substring' \
| fail
fi
else
if [[ $output != "$expected" ]]; then
batslib_print_kv_single_or_multi 8 \
'expected' "$expected" \
'actual' "$output" \
| batslib_decorate 'output differs' \
| fail
fi
fi
fi
}
# Fail and display details if the unexpected matches the actual output
# or a fragment of it.
#
# By default, the entire output is matched. The assertion fails if the
# unexpected output equals `$output'. Details include `$output'.
#
# When `-l <index>' is used, only the <index>-th line is matched. The
# assertion fails if the unexpected line equals `${lines[<index>}'.
# Details include the compared line and <index>.
#
# When `-l' is used without the <index> argument, the output is searched
# for the unexpected line. The unexpected line is matched against each
# line in `${lines[<index>]}'. If a match is found the assertion fails.
# Details include the unexpected line, the index where it was found and
# `$output' (with the unexpected line highlighted in it if `$output` is
# longer than one line).
#
# By default, literal matching is performed. Options `-p' and `-r'
# enable partial (i.e. substring) and extended regular expression
# matching, respectively. On failure, the substring or the regular
# expression is added to the details (if not already displayed).
# Specifying an invalid extended regular expression with `-r' displays
# an error.
#
# Options `-p' and `-r' are mutually exclusive. When used
# simultaneously, an error is displayed.
#
# Globals:
# output
# lines
# Options:
# -l <index> - match against the <index>-th element of `${lines[@]}'
# -l - search `${lines[@]}' for the unexpected line
# -p - partial matching
# -r - extended regular expression matching
# Arguments:
# $1 - unexpected output
# Returns:
# 0 - unexpected matches the actual output
# 1 - otherwise
# Outputs:
# STDERR - details, on failure
# error message, on error
refute_output() {
local -i is_match_line=0
local -i is_match_contained=0
local -i is_mode_partial=0
local -i is_mode_regex=0
# Handle options.
while (( $# > 0 )); do
case "$1" in
-l)
if (( $# > 2 )) && [[ $2 =~ ^([0-9]|[1-9][0-9]+)$ ]]; then
is_match_line=1
local -ri idx="$2"
shift
else
is_match_contained=1;
fi
shift
;;
-L) is_match_contained=1; shift ;;
-p) is_mode_partial=1; shift ;;
-r) is_mode_regex=1; shift ;;
--) break ;;
*) break ;;
esac
done
if (( is_match_line )) && (( is_match_contained )); then
echo "\`-l' and \`-l <index>' are mutually exclusive" \
| batslib_decorate 'ERROR: refute_output' \
| fail
return $?
fi
if (( is_mode_partial )) && (( is_mode_regex )); then
echo "\`-p' and \`-r' are mutually exclusive" \
| batslib_decorate 'ERROR: refute_output' \
| fail
return $?
fi
# Arguments.
local -r unexpected="$1"
if (( is_mode_regex == 1 )) && [[ '' =~ $unexpected ]] || (( $? == 2 )); then
echo "Invalid extended regular expression: \`$unexpected'" \
| batslib_decorate 'ERROR: refute_output' \
| fail
return $?
fi
# Matching.
if (( is_match_contained )); then
# Line contained in output.
if (( is_mode_regex )); then
local -i idx
for (( idx = 0; idx < ${#lines[@]}; ++idx )); do
if [[ ${lines[$idx]} =~ $unexpected ]]; then
{ local -ar single=(
'regex' "$unexpected"
'index' "$idx"
)
local -a may_be_multi=(
'output' "$output"
)
local -ir width="$( batslib_get_max_single_line_key_width \
"${single[@]}" "${may_be_multi[@]}" )"
batslib_print_kv_single "$width" "${single[@]}"
if batslib_is_single_line "${may_be_multi[1]}"; then
batslib_print_kv_single "$width" "${may_be_multi[@]}"
else
may_be_multi[1]="$( printf '%s' "${may_be_multi[1]}" \
| batslib_prefix \
| batslib_mark '>' "$idx" )"
batslib_print_kv_multi "${may_be_multi[@]}"
fi
} | batslib_decorate 'no line should match the regular expression' \
| fail
return $?
fi
done
elif (( is_mode_partial )); then
local -i idx
for (( idx = 0; idx < ${#lines[@]}; ++idx )); do
if [[ ${lines[$idx]} == *"$unexpected"* ]]; then
{ local -ar single=(
'substring' "$unexpected"
'index' "$idx"
)
local -a may_be_multi=(
'output' "$output"
)
local -ir width="$( batslib_get_max_single_line_key_width \
"${single[@]}" "${may_be_multi[@]}" )"
batslib_print_kv_single "$width" "${single[@]}"
if batslib_is_single_line "${may_be_multi[1]}"; then
batslib_print_kv_single "$width" "${may_be_multi[@]}"
else
may_be_multi[1]="$( printf '%s' "${may_be_multi[1]}" \
| batslib_prefix \
| batslib_mark '>' "$idx" )"
batslib_print_kv_multi "${may_be_multi[@]}"
fi
} | batslib_decorate 'no line should contain substring' \
| fail
return $?
fi
done
else
local -i idx
for (( idx = 0; idx < ${#lines[@]}; ++idx )); do
if [[ ${lines[$idx]} == "$unexpected" ]]; then
{ local -ar single=(
'line' "$unexpected"
'index' "$idx"
)
local -a may_be_multi=(
'output' "$output"
)
local -ir width="$( batslib_get_max_single_line_key_width \
"${single[@]}" "${may_be_multi[@]}" )"
batslib_print_kv_single "$width" "${single[@]}"
if batslib_is_single_line "${may_be_multi[1]}"; then
batslib_print_kv_single "$width" "${may_be_multi[@]}"
else
may_be_multi[1]="$( printf '%s' "${may_be_multi[1]}" \
| batslib_prefix \
| batslib_mark '>' "$idx" )"
batslib_print_kv_multi "${may_be_multi[@]}"
fi
} | batslib_decorate 'line should not be in output' \
| fail
return $?
fi
done
fi
elif (( is_match_line )); then
# Specific line.
if (( is_mode_regex )); then
if [[ ${lines[$idx]} =~ $unexpected ]] || (( $? == 0 )); then
batslib_print_kv_single 5 \
'index' "$idx" \
'regex' "$unexpected" \
'line' "${lines[$idx]}" \
| batslib_decorate 'regular expression should not match line' \
| fail
fi
elif (( is_mode_partial )); then
if [[ ${lines[$idx]} == *"$unexpected"* ]]; then
batslib_print_kv_single 9 \
'index' "$idx" \
'substring' "$unexpected" \
'line' "${lines[$idx]}" \
| batslib_decorate 'line should not contain substring' \
| fail
fi
else
if [[ ${lines[$idx]} == "$unexpected" ]]; then
batslib_print_kv_single 5 \
'index' "$idx" \
'line' "${lines[$idx]}" \
| batslib_decorate 'line should differ' \
| fail
fi
fi
else
# Entire output.
if (( is_mode_regex )); then
if [[ $output =~ $unexpected ]] || (( $? == 0 )); then
batslib_print_kv_single_or_multi 6 \
'regex' "$unexpected" \
'output' "$output" \
| batslib_decorate 'regular expression should not match output' \
| fail
fi
elif (( is_mode_partial )); then
if [[ $output == *"$unexpected"* ]]; then
batslib_print_kv_single_or_multi 9 \
'substring' "$unexpected" \
'output' "$output" \
| batslib_decorate 'output should not contain substring' \
| fail
fi
else
if [[ $output == "$unexpected" ]]; then
batslib_print_kv_single_or_multi 6 \
'output' "$output" \
| batslib_decorate 'output equals, but it was expected to differ' \
| fail
fi
fi
fi
}

View File

@ -1,264 +0,0 @@
#
# output.bash
# -----------
#
# Private functions implementing output formatting. Used by public
# helper functions.
#
# Print a message to the standard error. When no parameters are
# specified, the message is read from the standard input.
#
# Globals:
# none
# Arguments:
# $@ - [=STDIN] message
# Returns:
# none
# Inputs:
# STDIN - [=$@] message
# Outputs:
# STDERR - message
batslib_err() {
{ if (( $# > 0 )); then
echo "$@"
else
cat -
fi
} >&2
}
# Count the number of lines in the given string.
#
# TODO(ztombol): Fix tests and remove this note after #93 is resolved!
# NOTE: Due to a bug in Bats, `batslib_count_lines "$output"' does not
# give the same result as `${#lines[@]}' when the output contains
# empty lines.
# See PR #93 (https://github.com/sstephenson/bats/pull/93).
#
# Globals:
# none
# Arguments:
# $1 - string
# Returns:
# none
# Outputs:
# STDOUT - number of lines
batslib_count_lines() {
local -i n_lines=0
local line
while IFS='' read -r line || [[ -n $line ]]; do
(( ++n_lines ))
done < <(printf '%s' "$1")
echo "$n_lines"
}
# Determine whether all strings are single-line.
#
# Globals:
# none
# Arguments:
# $@ - strings
# Returns:
# 0 - all strings are single-line
# 1 - otherwise
batslib_is_single_line() {
for string in "$@"; do
(( $(batslib_count_lines "$string") > 1 )) && return 1
done
return 0
}
# Determine the length of the longest key that has a single-line value.
#
# This function is useful in determining the correct width of the key
# column in two-column format when some keys may have multi-line values
# and thus should be excluded.
#
# Globals:
# none
# Arguments:
# $odd - key
# $even - value of the previous key
# Returns:
# none
# Outputs:
# STDOUT - length of longest key
batslib_get_max_single_line_key_width() {
local -i max_len=-1
while (( $# != 0 )); do
local -i key_len="${#1}"
batslib_is_single_line "$2" && (( key_len > max_len )) && max_len="$key_len"
shift 2
done
echo "$max_len"
}
# Print key-value pairs in two-column format.
#
# Keys are displayed in the first column, and their corresponding values
# in the second. To evenly line up values, the key column is fixed-width
# and its width is specified with the first parameter (possibly computed
# using `batslib_get_max_single_line_key_width').
#
# Globals:
# none
# Arguments:
# $1 - width of key column
# $even - key
# $odd - value of the previous key
# Returns:
# none
# Outputs:
# STDOUT - formatted key-value pairs
batslib_print_kv_single() {
local -ir col_width="$1"; shift
while (( $# != 0 )); do
printf '%-*s : %s\n' "$col_width" "$1" "$2"
shift 2
done
}
# Print key-value pairs in multi-line format.
#
# The key is displayed first with the number of lines of its
# corresponding value in parenthesis. Next, starting on the next line,
# the value is displayed. For better readability, it is recommended to
# indent values using `batslib_prefix'.
#
# Globals:
# none
# Arguments:
# $odd - key
# $even - value of the previous key
# Returns:
# none
# Outputs:
# STDOUT - formatted key-value pairs
batslib_print_kv_multi() {
while (( $# != 0 )); do
printf '%s (%d lines):\n' "$1" "$( batslib_count_lines "$2" )"
printf '%s\n' "$2"
shift 2
done
}
# Print all key-value pairs in either two-column or multi-line format
# depending on whether all values are single-line.
#
# If all values are single-line, print all pairs in two-column format
# with the specified key column width (identical to using
# `batslib_print_kv_single').
#
# Otherwise, print all pairs in multi-line format after indenting values
# with two spaces for readability (identical to using `batslib_prefix'
# and `batslib_print_kv_multi')
#
# Globals:
# none
# Arguments:
# $1 - width of key column (for two-column format)
# $even - key
# $odd - value of the previous key
# Returns:
# none
# Outputs:
# STDOUT - formatted key-value pairs
batslib_print_kv_single_or_multi() {
local -ir width="$1"; shift
local -a pairs=( "$@" )
local -a values=()
local -i i
for (( i=1; i < ${#pairs[@]}; i+=2 )); do
values+=( "${pairs[$i]}" )
done
if batslib_is_single_line "${values[@]}"; then
batslib_print_kv_single "$width" "${pairs[@]}"
else
local -i i
for (( i=1; i < ${#pairs[@]}; i+=2 )); do
pairs[$i]="$( batslib_prefix < <(printf '%s' "${pairs[$i]}") )"
done
batslib_print_kv_multi "${pairs[@]}"
fi
}
# Prefix each line read from the standard input with the given string.
#
# Globals:
# none
# Arguments:
# $1 - [= ] prefix string
# Returns:
# none
# Inputs:
# STDIN - lines
# Outputs:
# STDOUT - prefixed lines
batslib_prefix() {
local -r prefix="${1:- }"
local line
while IFS='' read -r line || [[ -n $line ]]; do
printf '%s%s\n' "$prefix" "$line"
done
}
# Mark select lines of the text read from the standard input by
# overwriting their beginning with the given string.
#
# Usually the input is indented by a few spaces using `batslib_prefix'
# first.
#
# Globals:
# none
# Arguments:
# $1 - marking string
# $@ - indices (zero-based) of lines to mark
# Returns:
# none
# Inputs:
# STDIN - lines
# Outputs:
# STDOUT - lines after marking
batslib_mark() {
local -r symbol="$1"; shift
# Sort line numbers.
set -- $( sort -nu <<< "$( printf '%d\n' "$@" )" )
local line
local -i idx=0
while IFS='' read -r line || [[ -n $line ]]; do
if (( ${1:--1} == idx )); then
printf '%s\n' "${symbol}${line:${#symbol}}"
shift
else
printf '%s\n' "$line"
fi
(( ++idx ))
done
}
# Enclose the input text in header and footer lines.
#
# The header contains the given string as title. The output is preceded
# and followed by an additional newline to make it stand out more.
#
# Globals:
# none
# Arguments:
# $1 - title
# Returns:
# none
# Inputs:
# STDIN - text
# Outputs:
# STDOUT - decorated text
batslib_decorate() {
echo
echo "-- $1 --"
cat -
echo '--'
echo
}

View File

@ -1,66 +0,0 @@
## functions to help deal with docker
# Removes container $1
function docker_clean {
docker kill $1 &>/dev/null ||:
sleep .25s
docker rm -vf $1 &>/dev/null ||:
sleep .25s
}
# get the ip of docker container $1
function docker_ip {
docker inspect --format '{{ .NetworkSettings.IPAddress }}' $1
}
# get the ip of docker container $1
function docker_id {
docker inspect --format '{{ .ID }}' $1
}
# get the running state of container $1
# → true/false
# fails if the container does not exist
function docker_running_state {
docker inspect -f {{.State.Running}} $1
}
# get the docker container $1 PID
function docker_pid {
docker inspect --format {{.State.Pid}} $1
}
# asserts logs from container $1 contains $2
function docker_assert_log {
local -r container=$1
shift
run docker logs $container
assert_output -p "$*"
}
# wait for a container to produce a given text in its log
# $1 container
# $2 timeout in second
# $* text to wait for
function docker_wait_for_log {
local -r container=$1
local -ir timeout_sec=$2
shift 2
retry $(( $timeout_sec * 2 )) .5s docker_assert_log $container "$*"
}
# Create a docker container named $1 which exposes the docker host unix
# socket over tcp on port 2375.
#
# $1 container name
function docker_tcp {
local container_name="$1"
docker_clean $container_name
docker run -d \
--label bats-type="socat" \
--name $container_name \
--expose 2375 \
-v /var/run/docker.sock:/var/run/docker.sock \
rancher/socat-docker
docker run --label bats-type="docker" --link "$container_name:docker" docker:1.10 version
}

View File

@ -1,22 +0,0 @@
## add the retry function to bats
# Retry a command $1 times until it succeeds. Wait $2 seconds between retries.
function retry {
local attempts=$1
shift
local delay=$1
shift
local i
for ((i=0; i < attempts; i++)); do
run "$@"
if [ "$status" -eq 0 ]; then
echo "$output"
return 0
fi
sleep $delay
done
echo "Command \"$@\" failed $attempts times. Status: $status. Output: $output" >&2
false
}

View File

@ -1,24 +0,0 @@
-----BEGIN CERTIFICATE-----
MIID7TCCAtWgAwIBAgIJAOGkf5EnexJVMA0GCSqGSIb3DQEBCwUAMIGMMQswCQYD
VQQGEwJVUzERMA8GA1UECAwIVmlyZ2luaWExDzANBgNVBAcMBlJlc3RvbjERMA8G
A1UECgwIRmFrZSBPcmcxGzAZBgNVBAMMEioubmdpbngtcHJveHkuYmF0czEpMCcG
CSqGSIb3DQEJARYad2VibWFzdGVyQG5naW54LXByb3h5LmJhdHMwHhcNMTYwNDIw
MTUzOTUxWhcNMjYwNDE4MTUzOTUxWjCBjDELMAkGA1UEBhMCVVMxETAPBgNVBAgM
CFZpcmdpbmlhMQ8wDQYDVQQHDAZSZXN0b24xETAPBgNVBAoMCEZha2UgT3JnMRsw
GQYDVQQDDBIqLm5naW54LXByb3h5LmJhdHMxKTAnBgkqhkiG9w0BCQEWGndlYm1h
c3RlckBuZ2lueC1wcm94eS5iYXRzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEA0Amkj3iaQn8Z2CW6n24zSuWu2OoLCkHZAk8eprkI4kKoPBvjusynkm8E
phq65jebToHoldfuQ0wM61DzhD15bHwS3x9CrOVbShsmdnGALz+wdR0/4Likx50I
YZdecTOAlkoZudnX5FZ4ngOxjqcym7p5T8TrSS97a0fx99gitZY0p+Nu2tip4o3t
WBMs+SoPWTlQ1SrSmL8chC8O2knyBl/w1nHmDnMuR6FGcHdhLncApw9t5spgfv7p
OrMF4tQxJQNk10TnflmEMkGmy+pfk2e0cQ1Kwp3Nmzm7ECkggxxyjU3ihKiFK+09
8aSCi7gDAY925+mV6LZ5oLMpO3KJvQIDAQABo1AwTjAdBgNVHQ4EFgQU+NvFo37z
9Dyq8Mu82SPtV7q1gYQwHwYDVR0jBBgwFoAU+NvFo37z9Dyq8Mu82SPtV7q1gYQw
DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAI1ityDV0UsCVHSpB2LN+
QXlk8XS0ACIJ8Q0hbOj3BmYrdAVglG4P6upDEueaaxwsaBTagkTP8nxZ9dhfZHyZ
5YLNwYsiG5iqb8e0ecHx3uJT/0YiXn/8rBvxEZna4Fl8seGdp7BjOWUAS2Nv8tn4
EJJvRdfX/O8XgPc95DM4lwQ/dvyWmavMI4lnl0n1IQV9WPGaIQhYPU9WEQK6iMUB
o1kx8YbOJQD0ZBRfqpriNt1/8ylkkSYYav8QT9JFvQFCWEvaX71QF+cuOwC7ZYBH
4ElXwEUrYBHKiPo0q0VsTtMvLh7h/T5czrIhG/NpfVJPtQOk8aVwNScL3/n+TGU8
6g==
-----END CERTIFICATE-----

View File

@ -1,28 +0,0 @@
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDQCaSPeJpCfxnY
JbqfbjNK5a7Y6gsKQdkCTx6muQjiQqg8G+O6zKeSbwSmGrrmN5tOgeiV1+5DTAzr
UPOEPXlsfBLfH0Ks5VtKGyZ2cYAvP7B1HT/guKTHnQhhl15xM4CWShm52dfkVnie
A7GOpzKbunlPxOtJL3trR/H32CK1ljSn427a2Knije1YEyz5Kg9ZOVDVKtKYvxyE
Lw7aSfIGX/DWceYOcy5HoUZwd2EudwCnD23mymB+/uk6swXi1DElA2TXROd+WYQy
QabL6l+TZ7RxDUrCnc2bObsQKSCDHHKNTeKEqIUr7T3xpIKLuAMBj3bn6ZXotnmg
syk7com9AgMBAAECggEAa7wCp3XqVPNjW+c1/ShhkbDeWmDhtL8i9aopkmeSbTHd
07sRtQQU56Vsf+Sp010KpZ5q52Z6cglpS1eRtHLtdbvPPhL/QXBJVVg4E/B1VIKk
DBJIqUSVuPXeiEOOWgs01R+ssO1ae1o4foQlKF33vGPWPPQacL0RKh6I9TPNzcD7
n4rujlHk72N/bNydyK2rnyKB4vAI5TbZPLps+Xe123CmgZnW3JClcWV9B4foRmiu
a5Iq1WYAK2GYKbYwgqDRyYBC27m91a7U31pE4GQD+xQdlz6kcOlCU5hAcPK3h7j0
fLQqn8g+YAtc0nBKKB4NZe3QEzTiVMorT0VitxI71QKBgQDnirardZaXOFzYGzB3
j+FGB9BUW54hnHr5BxOYrfmEJ5umJjJWaGupfYrQsPArrJP1//WbqVZIPvdQParD
mQhLmSp1r/VNzGB6pISmzU1ZGDHsmBxYseh366om5YBQUFU2vmbil9VkrkM4fsJG
tcS9V/nVY/EM7Yp3PzjfLlhC1wKBgQDmA1YJmnZvIbLp3PoKqM69QiCLKztVm7nX
xpu3b3qbXEzXkt2sP5PHmr+s13hOPQFKRJ2hk4UN9WqpnFoHw5E5eWWhSa/peUZm
r10Y5XspiFtRHHiu6ABXB49eB4fen+vHEZHKyRJ4rFthKjjBHdNPC8bmwnT3jE85
/8a26FLZiwKBgQDXEi8JZslBn9YF2oOTm28KCLoHka551AsaA+u892T8z3mxxGsf
fhD7N6TYonIEb2Jkr6OpOortwqcgvpc+5oghCJ27AX2fDUdUxDp/YdYF+wZsmQJD
lMW1lo7PYIBmmaf9mLCiq5xIz+GauYul+LNNmUl0YEgI1SC4EV63WCodswKBgDMX
GJxHd/kVViVGFTAa8NjvAEWJU8OfNHduQRZMp8IsjVDw6VYiRRP4Fo0wyyMtv8Sc
WxsRpmNEWO3VsdW5pd9LTLy3nmBQtMeIOjiWeHXwOMBaf5/yHmk2X6z2JULY6Mkt
6OFPKlAtkJqTg0m58z7Ckeqd1NdLjimG27+y+PwjAoGAFt0cbC1Ust2BE6YEspSX
ofpAnJsyKrbF9iVUyXDUP99sdqYQfPJ5uqPGkP59lJGkTLtebuitqi6FCyrsT6Fq
AWLiExbqebAqcuAZw2S+iuK27S4rrkjVGF53J7vH3rOzCBUXaRx6GKfTjUqedHdg
9Kw+LP6IFnMTb+EGLo+GqHs=
-----END PRIVATE KEY-----

View File

@ -1,43 +0,0 @@
#!/usr/bin/env bats
load test_helpers
SUT_CONTAINER=bats-nginx-proxy-${TEST_FILE}
function setup {
# make sure to stop any web container before each test so we don't
# have any unexpected contaiener running with VIRTUAL_HOST or VIRUTAL_PORT set
stop_bats_containers web
}
@test "[$TEST_FILE] start a nginx-proxy container" {
run nginxproxy $SUT_CONTAINER -v /var/run/docker.sock:/tmp/docker.sock:ro
assert_success
docker_wait_for_log $SUT_CONTAINER 9 "Watching docker events"
}
@test "[$TEST_FILE] nginx-proxy forwards requests for 2 hosts" {
# WHEN a container runs a web server with VIRTUAL_HOST set for multiple hosts
prepare_web_container bats-multiple-hosts-1 80 -e VIRTUAL_HOST=multiple-hosts-1-A.bats,multiple-hosts-1-B.bats
dockergen_wait_for_event $SUT_CONTAINER start bats-multiple-hosts-1
sleep 1
# THEN querying the proxy without Host header → 503
run curl_container $SUT_CONTAINER / --head
assert_output -l 0 $'HTTP/1.1 503 Service Temporarily Unavailable\r'
# THEN querying the proxy with unknown Host header → 503
run curl_container $SUT_CONTAINER /data --header "Host: webFOO.bats" --head
assert_output -l 0 $'HTTP/1.1 503 Service Temporarily Unavailable\r'
# THEN
run curl_container $SUT_CONTAINER /data --header 'Host: multiple-hosts-1-A.bats'
assert_output "answer from port 80"
# THEN
run curl_container $SUT_CONTAINER /data --header 'Host: multiple-hosts-1-B.bats'
assert_output "answer from port 80"
}
@test "[$TEST_FILE] stop all bats containers" {
stop_bats_containers
}

View File

@ -1,64 +0,0 @@
#!/usr/bin/env bats
load test_helpers
SUT_CONTAINER=bats-nginx-proxy-${TEST_FILE}
function setup {
# make sure to stop any web container before each test so we don't
# have any unexpected contaiener running with VIRTUAL_HOST or VIRUTAL_PORT set
stop_bats_containers web
}
@test "[$TEST_FILE] start a nginx-proxy container" {
# GIVEN nginx-proxy
run nginxproxy $SUT_CONTAINER -v /var/run/docker.sock:/tmp/docker.sock:ro
assert_success
docker_wait_for_log $SUT_CONTAINER 9 "Watching docker events"
}
@test "[$TEST_FILE] nginx-proxy defaults to the service running on port 80" {
# WHEN
prepare_web_container bats-web-${TEST_FILE}-1 "80 90" -e VIRTUAL_HOST=web.bats
dockergen_wait_for_event $SUT_CONTAINER start bats-web-${TEST_FILE}-1
sleep 1
# THEN
assert_response_is_from_port 80
}
@test "[$TEST_FILE] VIRTUAL_PORT=90 while port 80 is also exposed" {
# GIVEN
prepare_web_container bats-web-${TEST_FILE}-2 "80 90" -e VIRTUAL_HOST=web.bats -e VIRTUAL_PORT=90
dockergen_wait_for_event $SUT_CONTAINER start bats-web-${TEST_FILE}-2
sleep 1
# THEN
assert_response_is_from_port 90
}
@test "[$TEST_FILE] single exposed port != 80" {
# GIVEN
prepare_web_container bats-web-${TEST_FILE}-3 1234 -e VIRTUAL_HOST=web.bats
dockergen_wait_for_event $SUT_CONTAINER start bats-web-${TEST_FILE}-3
sleep 1
# THEN
assert_response_is_from_port 1234
}
@test "[$TEST_FILE] stop all bats containers" {
stop_bats_containers
}
# assert querying nginx-proxy provides a response from the expected port of the web container
# $1 port we are expecting an response from
function assert_response_is_from_port {
local -r port=$1
run curl_container $SUT_CONTAINER /data --header "Host: web.bats"
assert_output "answer from port $port"
}

5
test/pytest.ini Normal file
View File

@ -0,0 +1,5 @@
[pytest]
# disable the creation of the `.cache` folders
addopts = -p no:cacheprovider --ignore=requirements --ignore=certs --color=yes -v
markers =
incremental: mark a test as incremental.

28
test/pytest.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/sh
###############################################################################
# #
# This script is meant to run the test suite from a Docker container. #
# #
# This is useful when you want to run the test suite from Mac or #
# Docker Toolbox. #
# #
###############################################################################
# Returns the absolute directory path to this script
TESTDIR=$(cd "${0%/*}" && pwd) || exit 1
DIR=$(cd "${TESTDIR}/.." && pwd) || exit 1
# check requirements
echo "> Building nginx-proxy-tester image..."
docker build --pull -t nginx-proxy-tester \
-f "${TESTDIR}/requirements/Dockerfile-nginx-proxy-tester" \
"${TESTDIR}/requirements" \
|| exit 1
# run the nginx-proxy-tester container setting the correct value for the working dir
# in order for docker compose to work properly when run from within that container.
exec docker run --rm -it --name "nginx-proxy-pytest" \
--volume "/var/run/docker.sock:/var/run/docker.sock" \
--volume "${DIR}:${DIR}" \
--workdir "${TESTDIR}" \
nginx-proxy-tester "$@"

View File

@ -0,0 +1,35 @@
FROM python:3.12
ENV PYTEST_RUNNING_IN_CONTAINER=1
COPY python-requirements.txt /requirements.txt
RUN pip install -r /requirements.txt
# Add Docker's official GPG key
RUN apt-get update \
&& apt-get install -y \
ca-certificates \
curl \
&& install -m 0755 -d /etc/apt/keyrings \
&& curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc \
&& chmod a+r /etc/apt/keyrings/docker.asc
# Add the Docker repository to Apt sources
RUN echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
# Install docker-ce-cli and docker-compose-plugin requirements for Pytest docker_compose fixture
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
docker-ce-cli \
docker-compose-plugin \
&& apt-get clean \
&& rm -r /var/lib/apt/lists/*
# Check if docker compose is available
RUN docker compose version
WORKDIR /test
ENTRYPOINT ["pytest"]

View File

@ -0,0 +1,52 @@
This directory contains resources to build Docker images tests depend on
# Build images
make build-webserver
# python-requirements.txt
If you want to run the test suite from your computer, you need python and a few python modules.
The _python-requirements.txt_ file describes the python modules required. To install them, use
pip:
pip install -r python-requirements.txt
If you don't want to run the test from your computer, you can run the tests from a docker container, see the _pytest.sh_ script.
# Images
## web
This container will run one or many webservers, each of them listening on a single port.
Ports are specified using the `WEB_PORTS` environment variable:
docker run -d -e WEB_PORTS=80 web # will create a container running one webserver listening on port 80
docker run -d -e WEB_PORTS="80 81" web # will create a container running two webservers, one listening on port 80 and a second one listening on port 81
The webserver answers on two paths:
- `/headers`
- `/port`
```
$ docker run -d -e WEB_PORTS=80 -p 80:80 web
$ curl http://127.0.0.1:80/headers
Host: 127.0.0.1
User-Agent: curl/7.47.0
Accept: */*
$ curl http://127.0.0.1:80/port
answer from port 80
```
## nginx-proxy-tester
This is an optional requirement which is usefull if you cannot (or don't want to) install pytest and its requirements on your computer. In this case, you can use the `nginx-proxy-tester` docker image to run the test suite from a Docker container.
To use this image, it is mandatory to run the container using the `pytest.sh` shell script. The script will build the image and run a container from it with the appropriate volumes and settings.

View File

@ -0,0 +1,6 @@
backoff==2.2.1
docker==7.1.0
packaging==24.2
pytest==8.3.4
requests==2.32.3
urllib3==2.3.0

View File

@ -0,0 +1,9 @@
# Docker Image running one (or multiple) webservers listening on all given ports from WEB_PORTS environment variable
FROM python:3-alpine
RUN apk add --no-cache bash
COPY ./webserver.py /
COPY ./entrypoint.sh /
WORKDIR /opt
ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]

View File

@ -0,0 +1,15 @@
#!/bin/bash
set -u
trap '[ ${#PIDS[@]} -gt 0 ] && kill -TERM ${PIDS[@]}' TERM
declare -a PIDS
for port in $WEB_PORTS; do
echo starting a web server listening on port "$port";
/webserver.py "$port" &
PIDS+=($!)
done
wait "${PIDS[@]}"
trap - TERM
wait "${PIDS[@]}"

View File

@ -0,0 +1,38 @@
#!/usr/bin/env python3
import os, sys, re
import http.server
import socketserver
class Handler(http.server.SimpleHTTPRequestHandler):
def do_GET(self):
response_body = ""
response_code = 200
if self.path == "/headers":
response_body += self.headers.as_string()
elif self.path == "/port":
response_body += f"answer from port {PORT}\n"
elif re.match(r"/status/(\d+)", self.path):
result = re.match(r"/status/(\d+)", self.path)
response_code = int(result.group(1))
response_body += f"answer with response code {response_code}\n"
elif self.path == "/":
response_body += f"I'm {os.environ['HOSTNAME']}\n"
else:
response_body += "No route for this path!\n"
response_code = 404
self.send_response(response_code)
self.send_header("Content-Type", "text/plain")
self.end_headers()
if len(response_body):
self.wfile.write(response_body.encode())
if __name__ == '__main__':
PORT = int(sys.argv[1])
socketserver.TCPServer.allow_reuse_address = True
httpd = socketserver.TCPServer(('0.0.0.0', PORT), Handler)
httpd.serve_forever()

View File

@ -1,146 +0,0 @@
#!/usr/bin/env bats
load test_helpers
SUT_CONTAINER=bats-nginx-proxy-${TEST_FILE}
function setup {
# make sure to stop any web container before each test so we don't
# have any unexpected contaiener running with VIRTUAL_HOST or VIRUTAL_PORT set
stop_bats_containers web
}
@test "[$TEST_FILE] start a nginx-proxy container" {
run nginxproxy $SUT_CONTAINER -v /var/run/docker.sock:/tmp/docker.sock:ro -v ${DIR}/lib/ssl:/etc/nginx/certs:ro
assert_success
docker_wait_for_log $SUT_CONTAINER 9 "Watching docker events"
}
@test "[$TEST_FILE] test SSL for VIRTUAL_HOST=*.nginx-proxy.bats" {
# WHEN
prepare_web_container bats-ssl-hosts-1 "80 443" \
-e VIRTUAL_HOST=*.nginx-proxy.bats \
-e CERT_NAME=nginx-proxy.bats
dockergen_wait_for_event $SUT_CONTAINER start bats-ssl-hosts-1
sleep 1
# THEN
assert_301 test.nginx-proxy.bats
assert_200_https test.nginx-proxy.bats
}
@test "[$TEST_FILE] test HTTPS_METHOD=nohttp" {
# WHEN
prepare_web_container bats-ssl-hosts-2 "80 443" \
-e VIRTUAL_HOST=*.nginx-proxy.bats \
-e CERT_NAME=nginx-proxy.bats \
-e HTTPS_METHOD=nohttp
dockergen_wait_for_event $SUT_CONTAINER start bats-ssl-hosts-2
sleep 1
# THEN
assert_503 test.nginx-proxy.bats
assert_200_https test.nginx-proxy.bats
}
@test "[$TEST_FILE] test HTTPS_METHOD=noredirect" {
# WHEN
prepare_web_container bats-ssl-hosts-3 "80 443" \
-e VIRTUAL_HOST=*.nginx-proxy.bats \
-e CERT_NAME=nginx-proxy.bats \
-e HTTPS_METHOD=noredirect
dockergen_wait_for_event $SUT_CONTAINER start bats-ssl-hosts-3
sleep 1
# THEN
assert_200 test.nginx-proxy.bats
assert_200_https test.nginx-proxy.bats
}
@test "[$TEST_FILE] test SSL Strict-Transport-Security" {
# WHEN
prepare_web_container bats-ssl-hosts-4 "80 443" \
-e VIRTUAL_HOST=*.nginx-proxy.bats \
-e CERT_NAME=nginx-proxy.bats
dockergen_wait_for_event $SUT_CONTAINER start bats-ssl-hosts-1
sleep 1
# THEN
assert_301 test.nginx-proxy.bats
assert_200_https test.nginx-proxy.bats
assert_output -p "Strict-Transport-Security: max-age=31536000"
}
@test "[$TEST_FILE] test HTTPS_METHOD=noredirect disables Strict-Transport-Security" {
# WHEN
prepare_web_container bats-ssl-hosts-5 "80 443" \
-e VIRTUAL_HOST=*.nginx-proxy.bats \
-e CERT_NAME=nginx-proxy.bats \
-e HTTPS_METHOD=noredirect
dockergen_wait_for_event $SUT_CONTAINER start bats-ssl-hosts-3
sleep 1
# THEN
assert_200 test.nginx-proxy.bats
assert_200_https test.nginx-proxy.bats
refute_output -p "Strict-Transport-Security: max-age=31536000"
}
@test "[$TEST_FILE] stop all bats containers" {
stop_bats_containers
}
# assert that querying nginx-proxy with the given Host header produces a `HTTP 200` response
# $1 Host HTTP header to use when querying nginx-proxy
function assert_200 {
local -r host=$1
run curl_container $SUT_CONTAINER / --head --header "Host: $host"
assert_output -l 0 $'HTTP/1.1 200 OK\r'
}
# assert that querying nginx-proxy with the given Host header produces a `HTTP 503` response
# $1 Host HTTP header to use when querying nginx-proxy
function assert_503 {
local -r host=$1
run curl_container $SUT_CONTAINER / --head --header "Host: $host"
assert_output -l 0 $'HTTP/1.1 503 Service Temporarily Unavailable\r'
}
# assert that querying nginx-proxy with the given Host header produces a `HTTP 503` response
# $1 Host HTTP header to use when querying nginx-proxy
function assert_301 {
local -r host=$1
run curl_container $SUT_CONTAINER / --head --header "Host: $host"
assert_output -l 0 $'HTTP/1.1 301 Moved Permanently\r'
}
# assert that querying nginx-proxy with the given Host header produces a `HTTP 200` response
# $1 Host HTTP header to use when querying nginx-proxy
function assert_200_https {
local -r host=$1
run curl_container_https $SUT_CONTAINER / --head --header "Host: $host"
assert_output -l 0 $'HTTP/1.1 200 OK\r'
}
# assert that querying nginx-proxy with the given Host header produces a `HTTP 503` response
# $1 Host HTTP header to use when querying nginx-proxy
function assert_503_https {
local -r host=$1
run curl_container_https $SUT_CONTAINER / --head --header "Host: $host"
assert_output -l 0 $'HTTP/1.1 503 Service Temporarily Unavailable\r'
}
# assert that querying nginx-proxy with the given Host header produces a `HTTP 503` response
# $1 Host HTTP header to use when querying nginx-proxy
function assert_301_https {
local -r host=$1
run curl_container_https $SUT_CONTAINER / --head --header "Host: $host"
assert_output -l 0 $'HTTP/1.1 301 Moved Permanently\r'
}

View File

@ -0,0 +1 @@
challenge-teststring

View File

@ -0,0 +1,70 @@
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 4096 (0x1000)
Signature Algorithm: sha256WithRSAEncryption
Issuer: O=nginx-proxy test suite, CN=www.nginx-proxy.tld
Validity
Not Before: Jan 10 00:08:52 2017 GMT
Not After : May 28 00:08:52 2044 GMT
Subject: CN=*.nginx-proxy.tld
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (2048 bit)
Modulus:
00:cb:45:f4:14:9b:fe:64:85:79:4a:36:8d:3d:d1:
27:d0:7c:36:28:30:e6:73:80:6f:7c:49:23:d0:6c:
17:e4:44:c0:77:4d:9a:c2:bc:24:84:e3:a5:4d:ba:
d2:da:51:7b:a1:2a:12:d4:c0:19:55:69:2c:22:27:
2d:1a:f6:fc:4b:7f:e9:cb:a8:3c:e8:69:b8:d2:4f:
de:4e:50:e2:d0:74:30:7c:42:5a:ae:aa:85:a5:b1:
71:4d:c9:7e:86:8b:62:8c:3e:0d:e3:3b:c3:f5:81:
0b:8c:68:79:fe:bf:10:fb:ae:ec:11:49:6d:64:5e:
1a:7d:b3:92:93:4e:96:19:3a:98:04:a7:66:b2:74:
61:2d:41:13:0c:a4:54:0d:2c:78:fd:b4:a3:e8:37:
78:9a:de:fa:bc:2e:a8:0f:67:14:58:ce:c3:87:d5:
14:0e:8b:29:7d:48:19:b2:a9:f5:b4:e8:af:32:21:
67:15:7e:43:52:8b:20:cf:9f:38:43:bf:fd:c8:24:
7f:52:a3:88:f2:f1:4a:14:91:2a:6e:91:6f:fb:7d:
6a:78:c6:6d:2e:dd:1e:4c:2b:63:bb:3a:43:9c:91:
f9:df:d3:08:13:63:86:7d:ce:e8:46:cf:f1:6c:1f:
ca:f7:4c:de:d8:4b:e0:da:bc:06:d9:87:0f:ff:96:
45:85
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Subject Alternative Name:
DNS:*.nginx-proxy.tld
Signature Algorithm: sha256WithRSAEncryption
6e:a5:0e:e4:d3:cc:d5:b7:fc:34:75:89:4e:98:8c:e7:08:06:
a8:5b:ec:13:7d:83:99:a2:61:b8:d5:12:6e:c5:b4:53:4e:9a:
22:cd:ad:14:30:6a:7d:58:d7:23:d9:a4:2a:96:a0:40:9e:50:
9f:ce:f2:fe:8c:dd:9a:ac:99:39:5b:89:2d:ca:e5:3e:c3:bc:
03:04:1c:12:d9:6e:b8:9f:f0:3a:be:12:44:7e:a4:21:86:73:
af:d5:00:51:3f:2c:56:70:34:8f:26:b0:7f:b0:cf:cf:7f:f9:
40:6f:00:29:c4:cf:c3:b7:c2:49:3d:3f:b0:26:78:87:b9:c7:
6c:1b:aa:6a:1a:dd:c5:eb:f2:69:ba:6d:46:0b:92:49:b5:11:
3c:eb:48:c7:2f:fb:33:a6:6a:82:a2:ab:f8:1e:5f:7d:e3:b7:
f2:fd:f5:88:a5:09:4d:a0:bc:f4:3b:cd:d2:8b:d7:57:1f:86:
3b:d2:3e:a4:92:21:b0:02:0b:e9:e0:c4:1c:f1:78:e2:58:a7:
26:5f:4c:29:c8:23:f0:6e:12:3f:bd:ad:44:7b:0b:bd:db:ba:
63:8d:07:c6:9d:dc:46:cc:63:40:ba:5e:45:82:dd:9a:e5:50:
e8:e7:d7:27:88:fc:6f:1d:8a:e7:5c:49:28:aa:10:29:75:28:
c7:52:de:f9
-----BEGIN CERTIFICATE-----
MIIC9zCCAd+gAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwPzEfMB0GA1UECgwWbmdp
bngtcHJveHkgdGVzdCBzdWl0ZTEcMBoGA1UEAwwTd3d3Lm5naW54LXByb3h5LnRs
ZDAeFw0xNzAxMTAwMDA4NTJaFw00NDA1MjgwMDA4NTJaMBwxGjAYBgNVBAMMESou
bmdpbngtcHJveHkudGxkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA
y0X0FJv+ZIV5SjaNPdEn0Hw2KDDmc4BvfEkj0GwX5ETAd02awrwkhOOlTbrS2lF7
oSoS1MAZVWksIictGvb8S3/py6g86Gm40k/eTlDi0HQwfEJarqqFpbFxTcl+hoti
jD4N4zvD9YELjGh5/r8Q+67sEUltZF4afbOSk06WGTqYBKdmsnRhLUETDKRUDSx4
/bSj6Dd4mt76vC6oD2cUWM7Dh9UUDospfUgZsqn1tOivMiFnFX5DUosgz584Q7/9
yCR/UqOI8vFKFJEqbpFv+31qeMZtLt0eTCtjuzpDnJH539MIE2OGfc7oRs/xbB/K
90ze2Evg2rwG2YcP/5ZFhQIDAQABoyAwHjAcBgNVHREEFTATghEqLm5naW54LXBy
b3h5LnRsZDANBgkqhkiG9w0BAQsFAAOCAQEAbqUO5NPM1bf8NHWJTpiM5wgGqFvs
E32DmaJhuNUSbsW0U06aIs2tFDBqfVjXI9mkKpagQJ5Qn87y/ozdmqyZOVuJLcrl
PsO8AwQcEtluuJ/wOr4SRH6kIYZzr9UAUT8sVnA0jyawf7DPz3/5QG8AKcTPw7fC
ST0/sCZ4h7nHbBuqahrdxevyabptRguSSbURPOtIxy/7M6ZqgqKr+B5ffeO38v31
iKUJTaC89DvN0ovXVx+GO9I+pJIhsAIL6eDEHPF44linJl9MKcgj8G4SP72tRHsL
vdu6Y40Hxp3cRsxjQLpeRYLdmuVQ6OfXJ4j8bx2K51xJKKoQKXUox1Le+Q==
-----END CERTIFICATE-----

View File

@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAy0X0FJv+ZIV5SjaNPdEn0Hw2KDDmc4BvfEkj0GwX5ETAd02a
wrwkhOOlTbrS2lF7oSoS1MAZVWksIictGvb8S3/py6g86Gm40k/eTlDi0HQwfEJa
rqqFpbFxTcl+hotijD4N4zvD9YELjGh5/r8Q+67sEUltZF4afbOSk06WGTqYBKdm
snRhLUETDKRUDSx4/bSj6Dd4mt76vC6oD2cUWM7Dh9UUDospfUgZsqn1tOivMiFn
FX5DUosgz584Q7/9yCR/UqOI8vFKFJEqbpFv+31qeMZtLt0eTCtjuzpDnJH539MI
E2OGfc7oRs/xbB/K90ze2Evg2rwG2YcP/5ZFhQIDAQABAoIBAQCjAro2PNLJMfCO
fyjNRgmzu6iCmpR0U68T8GN0JPsT576g7e8J828l0pkhuIyW33lRSThIvLSUNf9a
dChL032H3lBTLduKVh4NKleQXnVFzaeEPoISSFVdButiAhAhPW4OIUVp0OfY3V+x
fac3j2nDLAfL5SKAtqZv363Py9m66EBYm5BmGTQqT/frQWeCEBvlErQef5RIaU8p
e2zMWgSNNojVai8U3nKNRvYHWeWXM6Ck7lCvkHhMF+RpbmCZuqhbEARVnehU/Jdn
QHJ3nxeA2OWpoWKXvAHtSnno49yxq1UIstiQvY+ng5C5i56UlB60UiU2NJ6doZkB
uQ7/1MaBAoGBAORdcFtgdgRALjXngFWhpCp0CseyUehn1KhxDCG+D1pJ142/ymcf
oJOzKJPMRNDdDUBMnR1GBfy7rmwvYevI/SMNy2Qs7ofcXPbdtwwvTCToZ1V9/54k
VfuPBFT+3QzWRvG1tjTV3E4L2VV3nrl2qNPhE5DlfIaU3nQq5Fl0HprJAoGBAOPf
MWOTGev61CdODO5KN3pLAoamiPs5lEUlz3kM3L1Q52YLITxNDjRj9hWBUATJZOS2
pLOoYRwmhD7vrnimMc41+NuuFX+4T7hWPc8uSuOxX0VijYtULyNRK57mncG1Fq9M
RMLbOJ7FD+8jdXNsSMqpQ+pxLJRX/A10O2fOQnbdAoGAL5hV4YWSM0KZHvz332EI
ER0MXiCJN7HkPZMKH0I4eu3m8hEmAyYxVndBnsQ1F37q0xrkqAQ/HTSUntGlS/og
4Bxw5pkCwegoq/77tpto+ExDtSrEitYx4XMmSPyxX4qNULU5m3tzJgUML+b1etwD
Rd2kMU/TC02dq4KBAy/TbRkCgYAl1xN5iJz+XenLGR/2liZ+TWR+/bqzlU006mF4
pZUmbv/uJxz+yYD5XDwqOA4UrWjuvhG9r9FoflDprp2XdWnB556KxG7XhcDfSJr9
A5/2DadXe1Ur9O/a+oi2228JEsxQkea9QPA3FVxfBtFjOHEiDlez39VaUP4PMeUH
iO3qlQKBgFQhdTb7HeYnApYIDHLmd1PvjRvp8XKR1CpEN0nkw8HpHcT1q1MUjQCr
iT6FQupULEvGmO3frQsgVeRIQDbEdZK3C5xCtn6qOw70sYATVf361BbTtidmU9yV
THFxwDSVLiVZgFryoY/NtAc27sVdJnGsPRjjaeVgALAsLbmZ1K/H
-----END RSA PRIVATE KEY-----

View File

@ -0,0 +1,6 @@
services:
nginx-proxy:
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ${PYTEST_MODULE_PATH}/certs:/etc/nginx/certs:ro
- ${PYTEST_MODULE_PATH}/acme_root:/usr/share/nginx/html:ro

View File

@ -0,0 +1,27 @@
def test_redirect_acme_challenge_location_disabled(docker_compose, nginxproxy, acme_challenge_path):
r = nginxproxy.get(
f"http://web1.nginx-proxy.tld/{acme_challenge_path}",
allow_redirects=False
)
assert r.status_code == 301
def test_redirect_acme_challenge_location_enabled(docker_compose, nginxproxy, acme_challenge_path):
r = nginxproxy.get(
f"http://web2.nginx-proxy.tld/{acme_challenge_path}",
allow_redirects=False
)
assert r.status_code == 200
def test_noredirect_acme_challenge_location_disabled(docker_compose, nginxproxy, acme_challenge_path):
r = nginxproxy.get(
f"http://web3.nginx-proxy.tld/{acme_challenge_path}",
allow_redirects=False
)
assert r.status_code == 404
def test_noredirect_acme_challenge_location_enabled(docker_compose, nginxproxy, acme_challenge_path):
r = nginxproxy.get(
f"http://web4.nginx-proxy.tld/{acme_challenge_path}",
allow_redirects=False
)
assert r.status_code == 200

View File

@ -0,0 +1,40 @@
services:
nginx-proxy:
environment:
ACME_HTTP_CHALLENGE_LOCATION: "false"
web1:
image: web
expose:
- "81"
environment:
WEB_PORTS: "81"
VIRTUAL_HOST: "web1.nginx-proxy.tld"
web2:
image: web
expose:
- "82"
environment:
WEB_PORTS: "82"
VIRTUAL_HOST: "web2.nginx-proxy.tld"
ACME_HTTP_CHALLENGE_LOCATION: "true"
web3:
image: web
expose:
- "83"
environment:
WEB_PORTS: "83"
VIRTUAL_HOST: "web3.nginx-proxy.tld"
HTTPS_METHOD: noredirect
web4:
image: web
expose:
- "84"
environment:
WEB_PORTS: "84"
VIRTUAL_HOST: "web4.nginx-proxy.tld"
HTTPS_METHOD: noredirect
ACME_HTTP_CHALLENGE_LOCATION: "true"

View File

@ -0,0 +1,27 @@
def test_redirect_acme_challenge_location_enabled(docker_compose, nginxproxy, acme_challenge_path):
r = nginxproxy.get(
f"http://web1.nginx-proxy.tld/{acme_challenge_path}",
allow_redirects=False
)
assert r.status_code == 200
def test_redirect_acme_challenge_location_disabled(docker_compose, nginxproxy, acme_challenge_path):
r = nginxproxy.get(
f"http://web2.nginx-proxy.tld/{acme_challenge_path}",
allow_redirects=False
)
assert r.status_code == 301
def test_noredirect_acme_challenge_location_enabled(docker_compose, nginxproxy, acme_challenge_path):
r = nginxproxy.get(
f"http://web3.nginx-proxy.tld/{acme_challenge_path}",
allow_redirects=False
)
assert r.status_code == 200
def test_noredirect_acme_challenge_location_disabled(docker_compose, nginxproxy, acme_challenge_path):
r = nginxproxy.get(
f"http://web4.nginx-proxy.tld/{acme_challenge_path}",
allow_redirects=False
)
assert r.status_code == 404

View File

@ -0,0 +1,36 @@
services:
web1:
image: web
expose:
- "81"
environment:
WEB_PORTS: "81"
VIRTUAL_HOST: "web1.nginx-proxy.tld"
web2:
image: web
expose:
- "82"
environment:
WEB_PORTS: "82"
VIRTUAL_HOST: "web2.nginx-proxy.tld"
ACME_HTTP_CHALLENGE_LOCATION: "false"
web3:
image: web
expose:
- "83"
environment:
WEB_PORTS: "83"
VIRTUAL_HOST: "web3.nginx-proxy.tld"
HTTPS_METHOD: noredirect
web4:
image: web
expose:
- "84"
environment:
WEB_PORTS: "84"
VIRTUAL_HOST: "web4.nginx-proxy.tld"
HTTPS_METHOD: noredirect
ACME_HTTP_CHALLENGE_LOCATION: "false"

View File

@ -0,0 +1,13 @@
def test_redirect_acme_challenge_location_legacy(docker_compose, nginxproxy, acme_challenge_path):
r = nginxproxy.get(
f"http://web1.nginx-proxy.tld/{acme_challenge_path}",
allow_redirects=False
)
assert r.status_code == 200
def test_noredirect_acme_challenge_location_legacy(docker_compose, nginxproxy, acme_challenge_path):
r = nginxproxy.get(
f"http://web2.nginx-proxy.tld/{acme_challenge_path}",
allow_redirects=False
)
assert r.status_code == 404

View File

@ -0,0 +1,21 @@
services:
nginx-proxy:
environment:
ACME_HTTP_CHALLENGE_LOCATION: "legacy"
web1:
image: web
expose:
- "81"
environment:
WEB_PORTS: "81"
VIRTUAL_HOST: "web1.nginx-proxy.tld"
web2:
image: web
expose:
- "82"
environment:
WEB_PORTS: "82"
VIRTUAL_HOST: "web2.nginx-proxy.tld"
HTTPS_METHOD: noredirect

View File

@ -0,0 +1,66 @@
"""
Test that nginx-proxy-tester can build successfully
"""
import pathlib
import re
import docker
import pytest
client = docker.from_env()
@pytest.fixture(scope = "session")
def docker_build(request):
# Define Dockerfile path
current_file_path = pathlib.Path(__file__)
dockerfile_path = current_file_path.parent.parent.joinpath("requirements")
dockerfile_name = "Dockerfile-nginx-proxy-tester"
# Build the Docker image
image, logs = client.images.build(
path = dockerfile_path.as_posix(),
dockerfile = dockerfile_name,
rm = True, # Remove intermediate containers
tag = "nginx-proxy-tester-ci", # Tag for the built image
)
# Check for build success
for log in logs:
if "stream" in log:
print(log["stream"].strip())
if "error" in log:
raise Exception(log["error"])
def teardown():
# Clean up after teardown
client.images.remove(image.id, force=True)
request.addfinalizer(teardown)
# Return the image name
return "nginx-proxy-tester-ci"
def test_build_nginx_proxy_tester(docker_build):
assert docker_build == "nginx-proxy-tester-ci"
def test_run_nginx_proxy_tester(docker_build):
# Run the container with 'pytest -v' command to output version info
container = client.containers.run("nginx-proxy-tester-ci",
command = "pytest -V",
detach = True,
)
# Wait for the container to finish and get the exit code
result = container.wait()
exit_code = result.get("StatusCode", 1) # Default to 1 (error) if not found
# Get the output logs from the container
output = container.logs().decode("utf-8").strip()
# Clean up: Remove the container
container.remove()
# Assertions
assert exit_code == 0, "Container exited with a non-zero exit code"
assert re.search(r"pytest\s\d+\.\d+\.\d+", output)

View File

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<title>Maintenance</title>
<style>
html {
color-scheme: light dark;
}
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>Damn, there's some maintenance in progress.</h1>
<p>
Our apologies for this temporary inconvenience. Regular service
performance will be re-established shortly.
</p>
</body>
</html>

View File

@ -0,0 +1,7 @@
import re
def test_custom_error_page(docker_compose, nginxproxy):
r = nginxproxy.get("http://unknown.nginx-proxy.tld")
assert r.status_code == 503
assert re.search(r"Damn, there's some maintenance in progress.", r.text)

View File

@ -0,0 +1,5 @@
services:
nginx-proxy:
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ${PYTEST_MODULE_PATH}/50x.html:/usr/share/nginx/html/errors/50x.html:ro

View File

@ -0,0 +1 @@
add_header X-test bar;

View File

@ -0,0 +1 @@
add_header X-test f00;

View File

@ -0,0 +1,26 @@
def test_custom_default_conf_does_not_apply_to_unknown_vhost(docker_compose, nginxproxy):
r = nginxproxy.get("http://nginx-proxy/")
assert r.status_code == 503
assert "X-test" not in r.headers
def test_custom_default_conf_applies_to_web1(docker_compose, nginxproxy):
r = nginxproxy.get("http://web1.nginx-proxy.example/port")
assert r.status_code == 200
assert r.text == "answer from port 81\n"
assert "X-test" in r.headers
assert "f00" == r.headers["X-test"]
def test_custom_default_conf_applies_to_web2(docker_compose, nginxproxy):
r = nginxproxy.get("http://web2.nginx-proxy.example/port")
assert r.status_code == 200
assert r.text == "answer from port 82\n"
assert "X-test" in r.headers
assert "f00" == r.headers["X-test"]
def test_custom_default_conf_is_overriden_for_web3(docker_compose, nginxproxy):
r = nginxproxy.get("http://web3.nginx-proxy.example/port")
assert r.status_code == 200
assert r.text == "answer from port 83\n"
assert "X-test" in r.headers
assert "bar" == r.headers["X-test"]

View File

@ -0,0 +1,30 @@
services:
nginx-proxy:
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ${PYTEST_MODULE_PATH}/my_custom_proxy_settings_f00.conf:/etc/nginx/vhost.d/default_location:ro
- ${PYTEST_MODULE_PATH}/my_custom_proxy_settings_bar.conf:/etc/nginx/vhost.d/web3.nginx-proxy.example_location:ro
web1:
image: web
expose:
- "81"
environment:
WEB_PORTS: "81"
VIRTUAL_HOST: web1.nginx-proxy.example
web2:
image: web
expose:
- "82"
environment:
WEB_PORTS: "82"
VIRTUAL_HOST: web2.nginx-proxy.example
web3:
image: web
expose:
- "83"
environment:
WEB_PORTS: "83"
VIRTUAL_HOST: web3.nginx-proxy.example

View File

@ -0,0 +1,18 @@
def test_custom_conf_does_not_apply_to_unknown_vhost(docker_compose, nginxproxy):
r = nginxproxy.get("http://nginx-proxy/")
assert r.status_code == 503
assert "X-test" not in r.headers
def test_custom_conf_applies_to_web1(docker_compose, nginxproxy):
r = nginxproxy.get("http://web1.nginx-proxy.example/port")
assert r.status_code == 200
assert r.text == "answer from port 81\n"
assert "X-test" in r.headers
assert "f00" == r.headers["X-test"]
def test_custom_conf_applies_to_web2(docker_compose, nginxproxy):
r = nginxproxy.get("http://web2.nginx-proxy.example/port")
assert r.status_code == 200
assert r.text == "answer from port 82\n"
assert "X-test" in r.headers
assert "f00" == r.headers["X-test"]

View File

@ -0,0 +1,21 @@
services:
nginx-proxy:
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ${PYTEST_MODULE_PATH}/my_custom_proxy_settings_f00.conf:/etc/nginx/proxy.conf:ro
web1:
image: web
expose:
- "81"
environment:
WEB_PORTS: "81"
VIRTUAL_HOST: web1.nginx-proxy.example
web2:
image: web
expose:
- "82"
environment:
WEB_PORTS: "82"
VIRTUAL_HOST: web2.nginx-proxy.example

View File

@ -0,0 +1,27 @@
def test_custom_conf_does_not_apply_to_unknown_vhost(docker_compose, nginxproxy):
r = nginxproxy.get("http://nginx-proxy/")
assert r.status_code == 503
assert "X-test" not in r.headers
def test_custom_conf_applies_to_web1(docker_compose, nginxproxy):
r = nginxproxy.get("http://web1.nginx-proxy.example/port")
assert r.status_code == 200
assert r.text == "answer from port 81\n"
assert "X-test" in r.headers
assert "f00" == r.headers["X-test"]
def test_custom_conf_applies_to_regex(docker_compose, nginxproxy):
r = nginxproxy.get("http://regex.foo.nginx-proxy.example/port")
assert r.status_code == 200
assert r.text == "answer from port 83\n"
assert "X-test" in r.headers
assert "bar" == r.headers["X-test"]
def test_custom_conf_does_not_apply_to_web2(docker_compose, nginxproxy):
r = nginxproxy.get("http://web2.nginx-proxy.example/port")
assert r.status_code == 200
assert r.text == "answer from port 82\n"
assert "X-test" not in r.headers
def test_custom_block_is_present_in_nginx_generated_conf(docker_compose, nginxproxy):
assert b"include /etc/nginx/vhost.d/web1.nginx-proxy.example_location;" in nginxproxy.get_conf()

View File

@ -0,0 +1,30 @@
services:
nginx-proxy:
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ${PYTEST_MODULE_PATH}/my_custom_proxy_settings_f00.conf:/etc/nginx/vhost.d/web1.nginx-proxy.example_location:ro
- ${PYTEST_MODULE_PATH}/my_custom_proxy_settings_bar.conf:/etc/nginx/vhost.d/561032515ede3ab3a015edfb244608b72409c430_location:ro
web1:
image: web
expose:
- "81"
environment:
WEB_PORTS: "81"
VIRTUAL_HOST: web1.nginx-proxy.example
web2:
image: web
expose:
- "82"
environment:
WEB_PORTS: "82"
VIRTUAL_HOST: web2.nginx-proxy.example
regex:
image: web
expose:
- "83"
environment:
WEB_PORTS: "83"
VIRTUAL_HOST: ~^regex.*\.nginx-proxy\.example$

View File

@ -0,0 +1,24 @@
def test_custom_conf_does_not_apply_to_unknown_vhost(docker_compose, nginxproxy):
r = nginxproxy.get("http://nginx-proxy/")
assert r.status_code == 503
assert "X-test" not in r.headers
def test_custom_conf_applies_to_web1(docker_compose, nginxproxy):
r = nginxproxy.get("http://web1.nginx-proxy.example/port")
assert r.status_code == 200
assert r.text == "answer from port 81\n"
assert "X-test" in r.headers
assert "f00" == r.headers["X-test"]
def test_custom_conf_applies_to_regex(docker_compose, nginxproxy):
r = nginxproxy.get("http://regex.foo.nginx-proxy.example/port")
assert r.status_code == 200
assert r.text == "answer from port 83\n"
assert "X-test" in r.headers
assert "bar" == r.headers["X-test"]
def test_custom_conf_does_not_apply_to_web2(docker_compose, nginxproxy):
r = nginxproxy.get("http://web2.nginx-proxy.example/port")
assert r.status_code == 200
assert r.text == "answer from port 82\n"
assert "X-test" not in r.headers

View File

@ -0,0 +1,30 @@
services:
nginx-proxy:
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ${PYTEST_MODULE_PATH}/my_custom_proxy_settings_f00.conf:/etc/nginx/vhost.d/web1.nginx-proxy.example:ro
- ${PYTEST_MODULE_PATH}/my_custom_proxy_settings_bar.conf:/etc/nginx/vhost.d/561032515ede3ab3a015edfb244608b72409c430:ro
web1:
image: web
expose:
- "81"
environment:
WEB_PORTS: "81"
VIRTUAL_HOST: web1.nginx-proxy.example
web2:
image: web
expose:
- "82"
environment:
WEB_PORTS: "82"
VIRTUAL_HOST: web2.nginx-proxy.example
regex:
image: web
expose:
- "83"
environment:
WEB_PORTS: "83"
VIRTUAL_HOST: ~^regex.*\.nginx-proxy\.example$

View File

@ -0,0 +1,18 @@
def test_custom_conf_does_not_apply_to_unknown_vhost(docker_compose, nginxproxy):
r = nginxproxy.get("http://nginx-proxy/")
assert r.status_code == 503
assert "X-test" not in r.headers
def test_custom_conf_applies_to_web1(docker_compose, nginxproxy):
r = nginxproxy.get("http://web1.nginx-proxy.example/port")
assert r.status_code == 200
assert r.text == "answer from port 81\n"
assert "X-test" in r.headers
assert "f00" == r.headers["X-test"]
def test_custom_conf_applies_to_web2(docker_compose, nginxproxy):
r = nginxproxy.get("http://web2.nginx-proxy.example/port")
assert r.status_code == 200
assert r.text == "answer from port 82\n"
assert "X-test" in r.headers
assert "f00" == r.headers["X-test"]

View File

@ -0,0 +1,21 @@
services:
nginx-proxy:
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ${PYTEST_MODULE_PATH}/my_custom_proxy_settings_f00.conf:/etc/nginx/conf.d/my_custom_proxy_settings_f00.conf:ro
web1:
image: web
expose:
- "81"
environment:
WEB_PORTS: "81"
VIRTUAL_HOST: web1.nginx-proxy.example
web2:
image: web
expose:
- "82"
environment:
WEB_PORTS: "82"
VIRTUAL_HOST: web2.nginx-proxy.example

View File

@ -0,0 +1,48 @@
import json
import pytest
def test_debug_endpoint_is_enabled_globally(docker_compose, nginxproxy):
r = nginxproxy.get("http://enabled.debug.nginx-proxy.example/nginx-proxy-debug")
assert r.status_code == 200
r = nginxproxy.get("http://stripped.debug.nginx-proxy.example/nginx-proxy-debug")
assert r.status_code == 200
def test_debug_endpoint_response_contains_expected_values(docker_compose, nginxproxy):
r = nginxproxy.get("http://enabled.debug.nginx-proxy.example/nginx-proxy-debug")
assert r.status_code == 200
try:
jsonResponse = json.loads(r.text)
except ValueError as err:
pytest.fail("Failed to parse debug endpoint response as JSON: %s" % err, pytrace=False)
assert jsonResponse["global"]["enable_debug_endpoint"] == "true"
assert jsonResponse["vhost"]["enable_debug_endpoint"] == True
def test_debug_endpoint_paths_stripped_if_response_too_long(docker_compose, nginxproxy):
r = nginxproxy.get("http://stripped.debug.nginx-proxy.example/nginx-proxy-debug")
assert r.status_code == 200
try:
jsonResponse = json.loads(r.text)
except ValueError as err:
pytest.fail("Failed to parse debug endpoint response as JSON: %s" % err, pytrace=False)
if "paths" in jsonResponse["vhost"]:
pytest.fail("Expected paths to be stripped from debug endpoint response", pytrace=False)
assert jsonResponse["warning"] == "Virtual paths configuration for this hostname is too large and has been stripped from response."
def test_debug_endpoint_hostname_replaced_by_warning_if_regexp(docker_compose, nginxproxy):
r = nginxproxy.get("http://regexp.foo.debug.nginx-proxy.example/nginx-proxy-debug")
assert r.status_code == 200
try:
jsonResponse = json.loads(r.text)
except ValueError as err:
pytest.fail("Failed to parse debug endpoint response as JSON: %s" % err, pytrace=False)
assert jsonResponse["vhost"]["hostname"] == "Hostname is a regexp and unsafe to include in the debug response."
def test_debug_endpoint_is_disabled_per_container(docker_compose, nginxproxy):
r = nginxproxy.get("http://disabled.debug.nginx-proxy.example/nginx-proxy-debug")
assert r.status_code == 404

View File

@ -0,0 +1,59 @@
services:
nginx-proxy:
environment:
DEBUG_ENDPOINT: "true"
debug_enabled:
image: web
expose:
- "81"
environment:
WEB_PORTS: "81"
VIRTUAL_HOST: enabled.debug.nginx-proxy.example
debug_stripped:
image: web
expose:
- "82"
environment:
WEB_PORTS: "82"
VIRTUAL_HOST_MULTIPORTS: |-
stripped.debug.nginx-proxy.example:
"/1":
"/2":
"/3":
"/4":
"/5":
"/6":
"/7":
"/8":
"/9":
"/10":
"/11":
"/12":
"/13":
"/14":
"/15":
"/16":
"/17":
"/18":
"/19":
"/20":
debug_regexp:
image: web
expose:
- "84"
environment:
WEB_PORTS: "84"
VIRTUAL_HOST: ~^regexp.*\.debug.nginx-proxy.example
debug_disabled:
image: web
expose:
- "83"
environment:
WEB_PORTS: "83"
VIRTUAL_HOST: disabled.debug.nginx-proxy.example
labels:
com.github.nginx-proxy.nginx-proxy.debug-endpoint: "false"

View File

@ -0,0 +1,26 @@
import json
import pytest
def test_debug_endpoint_is_disabled_globally(docker_compose, nginxproxy):
r = nginxproxy.get("http://disabled1.debug.nginx-proxy.example/nginx-proxy-debug")
assert r.status_code == 404
r = nginxproxy.get("http://disabled2.debug.nginx-proxy.example/nginx-proxy-debug")
assert r.status_code == 404
def test_debug_endpoint_is_enabled_per_container(docker_compose, nginxproxy):
r = nginxproxy.get("http://enabled.debug.nginx-proxy.example/nginx-proxy-debug")
assert r.status_code == 200
def test_debug_endpoint_response_contains_expected_values(docker_compose, nginxproxy):
r = nginxproxy.get("http://enabled.debug.nginx-proxy.example/nginx-proxy-debug")
assert r.status_code == 200
try:
jsonResponse = json.loads(r.text)
except ValueError as err:
pytest.fail("Failed to parse debug endpoint response as JSON:: %s" % err, pytrace=False)
assert jsonResponse["global"]["enable_debug_endpoint"] == "false"
assert jsonResponse["vhost"]["enable_debug_endpoint"] == True

View File

@ -0,0 +1,27 @@
services:
debug_disabled1:
image: web
expose:
- "81"
environment:
WEB_PORTS: "81"
VIRTUAL_HOST: disabled1.debug.nginx-proxy.example
debug_disabled2:
image: web
expose:
- "82"
environment:
WEB_PORTS: "82"
VIRTUAL_HOST: disabled2.debug.nginx-proxy.example
debug_enabled:
image: web
expose:
- "83"
environment:
WEB_PORTS: "83"
VIRTUAL_HOST: enabled.debug.nginx-proxy.example
labels:
com.github.nginx-proxy.nginx-proxy.debug-endpoint: "true"

View File

@ -0,0 +1,4 @@
def test_fallback_on_default(docker_compose, nginxproxy):
r = nginxproxy.get("http://unknown.nginx-proxy.tld/port")
assert r.status_code == 200
assert r.text == "answer from port 81\n"

View File

@ -0,0 +1,12 @@
services:
nginx-proxy:
environment:
DEFAULT_HOST: web1.tld
web1:
image: web
expose:
- "81"
environment:
WEB_PORTS: "81"
VIRTUAL_HOST: web1.tld

View File

@ -0,0 +1,13 @@
def test_unknown_virtual_host(docker_compose, nginxproxy):
r = nginxproxy.get("http://nginx-proxy/port")
assert r.status_code == 503
def test_forwards_to_web1(docker_compose, nginxproxy):
r = nginxproxy.get("http://web1.nginx-proxy.tld/port")
assert r.status_code == 200
assert r.text == "answer from port 81\n"
def test_forwards_to_web2(docker_compose, nginxproxy):
r = nginxproxy.get("http://web2.nginx-proxy.tld/port")
assert r.status_code == 200
assert r.text == "answer from port 82\n"

View File

@ -0,0 +1,22 @@
services:
nginx-proxy:
volumes:
- /var/run/docker.sock:/f00.sock:ro
environment:
DOCKER_HOST: unix:///f00.sock
web1:
image: web
expose:
- "81"
environment:
WEB_PORTS: "81"
VIRTUAL_HOST: web1.nginx-proxy.tld
web2:
image: web
expose:
- "82"
environment:
WEB_PORTS: "82"
VIRTUAL_HOST: web2.nginx-proxy.tld

View File

@ -0,0 +1,30 @@
volumes:
nginx_conf:
services:
nginx-proxy-nginx:
image: nginx
container_name: nginx
volumes:
- nginx_conf:/etc/nginx/conf.d:ro
ports:
- "80:80"
- "443:443"
nginx-proxy-dockergen:
image: nginxproxy/docker-gen
command: -notify-sighup nginx -watch /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ../../nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl
- nginx_conf:/etc/nginx/conf.d
web:
image: web
container_name: whoami
expose:
- "80"
environment:
WEB_PORTS: "80"
VIRTUAL_HOST: whoami.nginx.container.docker

View File

@ -0,0 +1,27 @@
import docker
import pytest
from packaging.version import Version
raw_version = docker.from_env().version()["Version"]
pytestmark = pytest.mark.skipif(
Version(raw_version) < Version("1.13"),
reason="Docker compose syntax v3 requires docker engine v1.13 or later (got {raw_version})"
)
def test_unknown_virtual_host_is_503(docker_compose, nginxproxy):
r = nginxproxy.get("http://unknown.nginx.container.docker/")
assert r.status_code == 503
def test_forwards_to_whoami(docker_compose, nginxproxy):
r = nginxproxy.get("http://whoami.nginx.container.docker/")
assert r.status_code == 200
whoami_container = docker_compose.containers.get("whoami")
assert r.text == f"I'm {whoami_container.id[:12]}\n"
if __name__ == "__main__":
import doctest
doctest.testmod()

View File

@ -0,0 +1,15 @@
def test_nohttp_missing_cert_disabled(docker_compose, nginxproxy):
r = nginxproxy.get("http://nohttp-missing-cert-disabled.nginx-proxy.tld/", allow_redirects=False)
assert r.status_code == 503
def test_nohttp_missing_cert_enabled(docker_compose, nginxproxy):
r = nginxproxy.get("http://nohttp-missing-cert-enabled.nginx-proxy.tld/", allow_redirects=False)
assert r.status_code == 200
def test_redirect_missing_cert_disabled(docker_compose, nginxproxy):
r = nginxproxy.get("http://redirect-missing-cert-disabled.nginx-proxy.tld/", allow_redirects=False)
assert r.status_code == 301
def test_redirect_missing_cert_enabled(docker_compose, nginxproxy):
r = nginxproxy.get("http://redirect-missing-cert-enabled.nginx-proxy.tld/", allow_redirects=False)
assert r.status_code == 200

View File

@ -0,0 +1,40 @@
services:
nginx-proxy:
environment:
ENABLE_HTTP_ON_MISSING_CERT: "false"
nohttp-missing-cert-disabled:
image: web
expose:
- "81"
environment:
WEB_PORTS: "81"
VIRTUAL_HOST: nohttp-missing-cert-disabled.nginx-proxy.tld
HTTPS_METHOD: nohttp
nohttp-missing-cert-enabled:
image: web
expose:
- "82"
environment:
WEB_PORTS: "82"
VIRTUAL_HOST: nohttp-missing-cert-enabled.nginx-proxy.tld
HTTPS_METHOD: nohttp
ENABLE_HTTP_ON_MISSING_CERT: "true"
redirect-missing-cert-disabled:
image: web
expose:
- "83"
environment:
WEB_PORTS: "83"
VIRTUAL_HOST: redirect-missing-cert-disabled.nginx-proxy.tld
redirect-missing-cert-enabled:
image: web
expose:
- "84"
environment:
WEB_PORTS: "84"
VIRTUAL_HOST: redirect-missing-cert-enabled.nginx-proxy.tld
ENABLE_HTTP_ON_MISSING_CERT: "true"

View File

@ -0,0 +1,84 @@
"""
Test that nginx-proxy detects new containers
"""
from time import sleep
import pytest
from docker.errors import NotFound
@pytest.fixture
def web1(docker_compose):
"""
pytest fixture creating a web container with `VIRTUAL_HOST=web1.nginx-proxy` listening on port 81.
"""
container = docker_compose.containers.run(
name="web1",
image="web",
detach=True,
environment={
"WEB_PORTS": "81",
"VIRTUAL_HOST": "web1.nginx-proxy"
},
ports={"81/tcp": None}
)
docker_compose.networks.get("test_events-net").connect(container)
sleep(2) # give it some time to initialize and for docker-gen to detect it
yield container
try:
docker_compose.containers.get("web1").remove(force=True)
except NotFound:
pass
@pytest.fixture
def web2(docker_compose):
"""
pytest fixture creating a web container with `VIRTUAL_HOST=nginx-proxy`, `VIRTUAL_PATH=/web2/` and `VIRTUAL_DEST=/` listening on port 82.
"""
container = docker_compose.containers.run(
name="web2",
image="web",
detach=True,
environment={
"WEB_PORTS": "82",
"VIRTUAL_HOST": "nginx-proxy",
"VIRTUAL_PATH": "/web2/",
"VIRTUAL_DEST": "/",
},
ports={"82/tcp": None}
)
docker_compose.networks.get("test_events-net").connect(container)
sleep(2) # give it some time to initialize and for docker-gen to detect it
yield container
try:
docker_compose.containers.get("web2").remove(force=True)
except NotFound:
pass
def test_nginx_proxy_behavior_when_alone(docker_compose, nginxproxy):
r = nginxproxy.get("http://nginx-proxy/")
assert r.status_code == 503
def test_new_container_is_detected_vhost(web1, nginxproxy):
r = nginxproxy.get("http://web1.nginx-proxy/port")
assert r.status_code == 200
assert "answer from port 81\n" == r.text
web1.remove(force=True)
sleep(2)
r = nginxproxy.get("http://web1.nginx-proxy/port")
assert r.status_code == 503
def test_new_container_is_detected_vpath(web2, nginxproxy):
r = nginxproxy.get("http://nginx-proxy/web2/port")
assert r.status_code == 200
assert "answer from port 82\n" == r.text
r = nginxproxy.get("http://nginx-proxy/port")
assert r.status_code in [404, 503]
web2.remove(force=True)
sleep(2)
r = nginxproxy.get("http://nginx-proxy/web2/port")
assert r.status_code == 503

View File

@ -0,0 +1,3 @@
networks:
default:
name: test_events-net

View File

@ -0,0 +1,9 @@
services:
nginx-proxy:
image: nginxproxy/nginx-proxy:test
container_name: nginx-proxy
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
ports:
- "80:80"
- "443:443"

View File

@ -0,0 +1,5 @@
server {
server_name __;
listen 80 default_server;
return 418;
}

View File

@ -0,0 +1,14 @@
services:
nginx-proxy:
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ${PYTEST_MODULE_PATH}/test_fallback.data/custom-fallback.conf:/etc/nginx/conf.d/zzz-custom-fallback.conf:ro
http-only:
image: web
expose:
- "83"
environment:
WEB_PORTS: "83"
VIRTUAL_HOST: http-only.nginx-proxy.test
HTTPS_METHOD: nohttps

View File

@ -0,0 +1,71 @@
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 4096 (0x1000)
Signature Algorithm: sha256WithRSAEncryption
Issuer: O=nginx-proxy test suite, CN=www.nginx-proxy.tld
Validity
Not Before: Feb 7 21:54:16 2023 GMT
Not After : Jun 25 21:54:16 2050 GMT
Subject: CN=http-only.nginx-proxy.test
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
RSA Public-Key: (2048 bit)
Modulus:
00:b4:62:61:07:54:2e:6d:55:83:2d:24:b7:e2:15:
34:13:bd:79:21:e9:10:75:3f:4c:f8:ba:60:29:87:
e5:8e:2a:1e:fd:33:51:5a:8a:3a:6f:60:ff:24:f1:
1b:27:30:8c:ac:43:04:b7:79:cb:7a:ec:c6:08:a4:
a0:15:b0:0f:ee:6b:15:84:24:11:bc:85:2b:48:06:
04:0a:58:bb:8c:e8:4d:48:f5:06:c5:91:fe:5d:99:
0a:29:31:8a:f1:9b:0c:e0:39:75:a1:06:9b:d4:f5:
06:74:8f:46:5e:64:ba:2f:d0:3d:7c:3d:30:03:e9:
7c:35:17:69:04:f6:2e:29:d4:93:d6:d6:d2:6c:04:
38:06:21:06:05:30:8a:b9:9d:05:8d:12:6e:48:39:
bb:f6:93:4f:ba:a5:84:c7:96:2f:be:92:25:e9:d0:
95:2a:d9:23:8a:b3:28:0b:b6:19:1c:3b:be:a2:91:
70:44:a8:77:18:94:4b:df:61:f4:5c:c9:78:76:34:
b5:87:0f:c0:92:04:26:b6:ca:62:cd:9b:5d:eb:bf:
10:ac:df:af:72:5f:af:09:38:b1:dc:e1:3d:13:db:
a0:ac:b7:2e:ca:39:5c:4c:f1:1e:81:a8:b4:44:a2:
72:d5:3b:c0:71:cc:dc:16:0d:fa:38:96:44:b3:00:
d6:65
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Subject Alternative Name:
DNS:http-only.nginx-proxy.test
Signature Algorithm: sha256WithRSAEncryption
3b:54:95:48:4d:f6:93:38:42:40:02:ab:b7:17:3b:50:3b:ca:
c7:12:69:b0:da:cb:d7:3e:0e:1f:bf:a2:59:c7:fe:c2:5c:43:
84:92:b9:3a:be:8f:7e:2e:81:3c:ed:f3:a9:77:21:c2:35:f1:
da:cf:3a:1e:e2:ee:a2:ce:72:55:97:87:0e:ad:59:61:f7:75:
46:c0:2b:d4:88:b7:36:97:11:fb:5e:28:89:e9:2a:92:f1:15:
f1:43:8e:c1:38:85:8d:3a:26:7d:25:72:93:17:96:8d:5a:ed:
e8:73:3a:d5:8d:80:f2:af:38:84:ff:85:2e:d1:36:7d:2e:e1:
f0:2c:d8:15:5f:fc:c5:70:5d:25:6a:22:f3:2a:cd:0f:25:ad:
d4:93:d3:9a:3e:50:bc:da:a5:6c:86:ea:1d:d9:b9:c5:90:db:
f5:02:c8:c9:77:5c:ef:77:fe:74:60:41:33:d9:3c:a2:e1:73:
aa:14:18:5d:36:58:c8:41:63:4c:59:0e:4b:3d:c5:65:5a:01:
b0:16:50:0f:d0:4f:0d:ca:97:f6:11:47:06:6b:b1:ae:bb:26:
30:34:8b:7a:91:5d:8a:22:c7:f9:05:0d:bb:a5:b7:60:c0:20:
ce:d0:0e:c0:66:b3:e7:c4:61:ec:c5:40:e6:52:11:41:c3:11:
18:04:c7:1e
-----BEGIN CERTIFICATE-----
MIIDCzCCAfOgAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwPzEfMB0GA1UECgwWbmdp
bngtcHJveHkgdGVzdCBzdWl0ZTEcMBoGA1UEAwwTd3d3Lm5naW54LXByb3h5LnRs
ZDAgFw0yMzAyMDcyMTU0MTZaGA8yMDUwMDYyNTIxNTQxNlowJTEjMCEGA1UEAwwa
aHR0cC1vbmx5Lm5naW54LXByb3h5LnRlc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IB
DwAwggEKAoIBAQC0YmEHVC5tVYMtJLfiFTQTvXkh6RB1P0z4umAph+WOKh79M1Fa
ijpvYP8k8RsnMIysQwS3ect67MYIpKAVsA/uaxWEJBG8hStIBgQKWLuM6E1I9QbF
kf5dmQopMYrxmwzgOXWhBpvU9QZ0j0ZeZLov0D18PTAD6Xw1F2kE9i4p1JPW1tJs
BDgGIQYFMIq5nQWNEm5IObv2k0+6pYTHli++kiXp0JUq2SOKsygLthkcO76ikXBE
qHcYlEvfYfRcyXh2NLWHD8CSBCa2ymLNm13rvxCs369yX68JOLHc4T0T26Csty7K
OVxM8R6BqLREonLVO8BxzNwWDfo4lkSzANZlAgMBAAGjKTAnMCUGA1UdEQQeMByC
Gmh0dHAtb25seS5uZ2lueC1wcm94eS50ZXN0MA0GCSqGSIb3DQEBCwUAA4IBAQA7
VJVITfaTOEJAAqu3FztQO8rHEmmw2svXPg4fv6JZx/7CXEOEkrk6vo9+LoE87fOp
dyHCNfHazzoe4u6iznJVl4cOrVlh93VGwCvUiLc2lxH7XiiJ6SqS8RXxQ47BOIWN
OiZ9JXKTF5aNWu3oczrVjYDyrziE/4Uu0TZ9LuHwLNgVX/zFcF0laiLzKs0PJa3U
k9OaPlC82qVshuod2bnFkNv1AsjJd1zvd/50YEEz2Tyi4XOqFBhdNljIQWNMWQ5L
PcVlWgGwFlAP0E8Nypf2EUcGa7GuuyYwNIt6kV2KIsf5BQ27pbdgwCDO0A7AZrPn
xGHsxUDmUhFBwxEYBMce
-----END CERTIFICATE-----

View File

@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAtGJhB1QubVWDLSS34hU0E715IekQdT9M+LpgKYfljioe/TNR
Woo6b2D/JPEbJzCMrEMEt3nLeuzGCKSgFbAP7msVhCQRvIUrSAYECli7jOhNSPUG
xZH+XZkKKTGK8ZsM4Dl1oQab1PUGdI9GXmS6L9A9fD0wA+l8NRdpBPYuKdST1tbS
bAQ4BiEGBTCKuZ0FjRJuSDm79pNPuqWEx5YvvpIl6dCVKtkjirMoC7YZHDu+opFw
RKh3GJRL32H0XMl4djS1hw/AkgQmtspizZtd678QrN+vcl+vCTix3OE9E9ugrLcu
yjlcTPEegai0RKJy1TvAcczcFg36OJZEswDWZQIDAQABAoIBAAfDA/HQyX6i41YZ
8l+kEe2XhZLT+IVTB/jb7C9dTZ9kaJj0kFeZAxKv1cq9JTH2gNcYuyc58muDrLHK
g6jrPoQ/z1k0RB8ci9Q5jgrz7n4NsOWmxXfS5GMaprlHDHeA+HjdgBZBtorfUDvL
vndpVimgiETETUCd115hd39jKHFcRcdV6yCix7ObywK3dMgLVpagCcnlyCWffS/r
nhhMfJ+VstW0nUtfZ7JEYwT6Cg7lLAVtDkqPX8zGjJiRwUKH808bUyqEw1y5Cc8U
U5hbmMgPWfXsKxsEC6FSVHBG9ZX2jymOMQXijLFcBSuWvADHmyU+ZxXcbtd1rv4E
cGFj3wECgYEA5cNrr5WjrpEin6MYYVWxiQ+xEWPU2R17eApagrDRLM41JJpv7a5m
TYuZRfIxb59CBPi718Gi168P3T2KMvo2/BTh9Lq5ZBYHx3aDqW2QvMFn7/tgamj8
0DBxccd2QWfGIBrT1rAF7lD8TC86wtDDVKrvhucRSEXVKF/jWFFRGfUCgYEAyPt6
48khr7sfNMVdkDLjQjZVV6H7ZUMoSn0FGybgKWxW+b0XCBPObUQWIpyCNTRr1+4A
1TAUS+F/OVVfwnLNgemeE2wd6CaduxwiK1U4pHbyXCElH1ifonHWV3MoXOefYsiY
q5z2jfJzUi0JZVUKsveu9rQsFLsc//1s/I5T1LECgYEAldY6fNg2VVp63OZsuNU8
oSiljbSwEyMh6Oe/nOkYkIKtr4AzrCoGt11piG7ohGW0lS9suMijnMqiquI+JP5+
KyinLoUy761aR17nf+9e62mpkZw6hUqQTGi7Irs0SHUXhMpaCfDi/Ua9MiW+yVuB
ds6+xBgeciZwWxMlXOwy2p0CgYEAm+YWiSK3Mq0fo7uEvBn9Fps2z+ciLoZNdppL
n6gkMX2MaeQ3PVi/wxoRYX+tsL+c973yf2vwEnw0R7Dlutt6dc9VgxNWj4GE0GMe
Tiao7Uom7Tf4p7wC9+r9rI/zOz2f8OxRIK18wtbShWfR5fx1dCWUXmGb3+jUse1O
4Qk2FcECgYAvSvGFoJb8tuHFEYYHBbjficmvTUsrTE+EhxPqWKFhKfF19fFFIupy
XBCrN6nwrh+/YMxZXeIRbbTTf814cOO7PjLeNhnfhJZkaJq1HzbYe3bOurna3qrm
Ra3xiM8Ld2PyGnZPXf8+AWhMhuPkLX1KFVTCAxwCpmTZCHtiGCmXMA==
-----END RSA PRIVATE KEY-----

View File

@ -0,0 +1,71 @@
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 4096 (0x1000)
Signature Algorithm: sha256WithRSAEncryption
Issuer: O=nginx-proxy test suite, CN=www.nginx-proxy.tld
Validity
Not Before: Feb 7 21:53:19 2023 GMT
Not After : Jun 25 21:53:19 2050 GMT
Subject: CN=https-and-http.nginx-proxy.test
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
RSA Public-Key: (2048 bit)
Modulus:
00:b7:97:85:d1:7f:6b:50:29:f3:87:b7:4e:f5:25:
40:6a:d8:fa:a1:63:3c:4a:2e:68:4a:c6:8b:38:df:
07:81:d0:08:9d:fc:17:f5:37:28:7f:31:e6:f3:81:
28:4e:22:b6:bd:a2:4e:f2:2f:e5:0f:dd:55:3c:e1:
04:84:4c:45:1b:1a:ae:b7:f0:2a:da:43:05:71:91:
92:b8:d1:49:fe:80:0a:53:b9:66:da:54:60:9a:fc:
e1:b2:e8:28:48:7f:96:94:3c:92:a3:b2:37:f6:7a:
c2:de:0b:12:f0:ae:4e:92:fe:2d:c1:b2:95:28:1f:
88:8d:79:99:81:19:ae:22:a4:95:f5:9f:db:25:8e:
1d:cf:43:cd:6f:85:93:5f:79:ee:f8:f3:d4:82:e1:
e9:4d:c9:ad:ae:5b:92:43:3a:3c:71:51:70:f7:3e:
bd:1b:24:52:6a:a3:cf:54:72:57:ed:fe:72:ea:96:
9b:5a:02:02:a7:df:85:b7:68:ae:1e:07:77:9f:59:
a5:a0:8b:28:c2:c8:b7:bb:8a:42:50:df:05:73:bf:
9c:55:13:b5:82:79:77:40:57:a4:8f:88:a5:71:50:
d7:70:b0:4d:0c:d9:86:b3:9b:db:8a:20:bd:19:68:
10:52:2d:53:ba:0e:2e:1c:ad:80:54:bb:b6:c9:ab:
11:39
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Subject Alternative Name:
DNS:https-and-http.nginx-proxy.test
Signature Algorithm: sha256WithRSAEncryption
2c:f3:e5:47:3f:8e:5a:28:b1:df:e5:95:50:85:6f:27:2f:a6:
8d:f1:5e:cf:df:e2:52:66:97:61:36:59:81:26:25:19:99:c9:
93:e5:85:cb:ca:69:af:4b:21:a3:d2:7a:bf:b5:5e:2d:42:fb:
99:f8:22:58:e5:bf:79:b8:8a:74:7e:c6:94:14:d9:f2:27:63:
b6:e5:74:21:5b:59:fb:f6:c8:a9:28:fb:60:f7:5e:bd:c2:e6:
74:24:14:96:61:95:6c:c2:66:b4:52:25:a1:85:5a:97:e5:68:
5c:62:cf:69:3b:b0:a9:56:d8:e3:5f:74:dc:84:18:d5:3e:4f:
c9:35:39:26:88:dc:9b:80:d9:40:e1:4f:09:27:8d:d2:89:55:
30:91:02:86:35:04:95:1e:1d:58:14:5b:c6:e0:2e:a7:bf:a8:
f6:2b:76:8a:4e:71:79:bc:c0:04:cd:db:81:73:46:ce:68:ed:
25:b0:0e:42:8d:96:64:77:3b:f4:9d:1a:c9:f6:78:4c:56:4f:
92:17:29:3d:80:50:71:77:4b:a8:29:c2:12:fc:ad:0a:37:81:
38:4c:fb:54:99:4d:12:5f:98:dc:d1:a9:7b:08:45:c4:6f:7e:
fe:00:e0:db:79:fe:d1:28:e3:8e:82:d1:fb:bc:0a:c4:42:93:
c9:5e:eb:ba
-----BEGIN CERTIFICATE-----
MIIDFTCCAf2gAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwPzEfMB0GA1UECgwWbmdp
bngtcHJveHkgdGVzdCBzdWl0ZTEcMBoGA1UEAwwTd3d3Lm5naW54LXByb3h5LnRs
ZDAgFw0yMzAyMDcyMTUzMTlaGA8yMDUwMDYyNTIxNTMxOVowKjEoMCYGA1UEAwwf
aHR0cHMtYW5kLWh0dHAubmdpbngtcHJveHkudGVzdDCCASIwDQYJKoZIhvcNAQEB
BQADggEPADCCAQoCggEBALeXhdF/a1Ap84e3TvUlQGrY+qFjPEouaErGizjfB4HQ
CJ38F/U3KH8x5vOBKE4itr2iTvIv5Q/dVTzhBIRMRRsarrfwKtpDBXGRkrjRSf6A
ClO5ZtpUYJr84bLoKEh/lpQ8kqOyN/Z6wt4LEvCuTpL+LcGylSgfiI15mYEZriKk
lfWf2yWOHc9DzW+Fk1957vjz1ILh6U3Jra5bkkM6PHFRcPc+vRskUmqjz1RyV+3+
cuqWm1oCAqffhbdorh4Hd59ZpaCLKMLIt7uKQlDfBXO/nFUTtYJ5d0BXpI+IpXFQ
13CwTQzZhrOb24ogvRloEFItU7oOLhytgFS7tsmrETkCAwEAAaMuMCwwKgYDVR0R
BCMwIYIfaHR0cHMtYW5kLWh0dHAubmdpbngtcHJveHkudGVzdDANBgkqhkiG9w0B
AQsFAAOCAQEALPPlRz+OWiix3+WVUIVvJy+mjfFez9/iUmaXYTZZgSYlGZnJk+WF
y8ppr0sho9J6v7VeLUL7mfgiWOW/ebiKdH7GlBTZ8idjtuV0IVtZ+/bIqSj7YPde
vcLmdCQUlmGVbMJmtFIloYVal+VoXGLPaTuwqVbY41903IQY1T5PyTU5Jojcm4DZ
QOFPCSeN0olVMJEChjUElR4dWBRbxuAup7+o9it2ik5xebzABM3bgXNGzmjtJbAO
Qo2WZHc79J0ayfZ4TFZPkhcpPYBQcXdLqCnCEvytCjeBOEz7VJlNEl+Y3NGpewhF
xG9+/gDg23n+0SjjjoLR+7wKxEKTyV7rug==
-----END CERTIFICATE-----

View File

@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAt5eF0X9rUCnzh7dO9SVAatj6oWM8Si5oSsaLON8HgdAInfwX
9TcofzHm84EoTiK2vaJO8i/lD91VPOEEhExFGxqut/Aq2kMFcZGSuNFJ/oAKU7lm
2lRgmvzhsugoSH+WlDySo7I39nrC3gsS8K5Okv4twbKVKB+IjXmZgRmuIqSV9Z/b
JY4dz0PNb4WTX3nu+PPUguHpTcmtrluSQzo8cVFw9z69GyRSaqPPVHJX7f5y6pab
WgICp9+Ft2iuHgd3n1mloIsowsi3u4pCUN8Fc7+cVRO1gnl3QFekj4ilcVDXcLBN
DNmGs5vbiiC9GWgQUi1Tug4uHK2AVLu2yasROQIDAQABAoIBACT4KSVHoEdzOyvw
GME6sB8T9Fw9TG2vrKaqFmzsVGmqh6Gwmu5xHgGG/fe44XHigaPsJDOWu2yXaEur
ECrH5P6RP++gODDdYCI/ayk2U80g4XN8mR6L8Swkkhphr4Lx1lOhYvH9uFE05Tqr
RjQbFY16C6K+oFSFDQ1YGDYsAqnM3RD7PH+lHpo8UN1TO/vogdSQEpMYZDwLAYnW
uD5G3c0u2PsGu9YLuz2p8hcs3chh+cqKJWXOeW0JLrNGx1bqeQWkn6nXRDdRYi9V
cJlTgDqGuF54bieSyq9ABDZQP4Ol+moYKDoIz5PwurNjcYSklrT1tw0gqHZoQK1L
fDjw3QECgYEA7QMRU1AFKTvO7/8WLHLN5BT63n31wm0e9PYpz/XVLWEfxBcp9Xmf
xAIhXZ/U9P4dfNqxTjN9mVGzCHh5KfDJnUFqOXFy/zvfMeRzJf6dJo6/4OX9Bijr
Tgd454vyGXYQP2t+F14UAwl6vlGOAjttiP5qY5Ef1gllBEeIPe9Ts9kCgYEAxkzZ
pq4HJ/5/iDquMEHXNXzpNPavSvgxQdl1ILvJ49LJImmQFBCP9PqiOTIfePz1OqUI
C4baFuc0FEDJ3x9CUNmMY1lEi2ZUq2agPSXaQNsMcKtEJH8SoJlJIRpkQA7unX09
zb4dam6g79OaGmb8scePuezXMLv1Ee6WWtXbzGECgYEA6PYn9Gzl9cacu9dOUzgw
2ewpPcIvawDY+cxwAsHO3MDneVWPX4JBoGa7pwvwRTL1hwBqYMRJwwbD5CKObcQI
V/KxV28Eqo2N77tt1z2x9/E99u/4yTI1P0gm9ejfeVlL1RpyIMPPBcEujZ0Z6WXC
X3I63k0KLtajHRa2erIf4tkCgYAfunAgwTuX5JqXO3xfcEl033WY6deGUUvgU2Dw
Sdu1viY8gVNyQmwmMGwAZsquWxsJtRoibgM7IucsTml+b8v2j7hstP3IqCjn+9Wr
swDG28WTyXNvu31JgP04dLaRoVIAlOdsofym6OiLNvozO0M3VsziXMjZnVlK8zfP
dORkQQKBgQDXAJEJPygxVA+bF104dzCMWGmU7K8ShEWC5eOdKK4KWf9bNDpY6M6c
i6zga/xBbj7e3Bxqprpp8Wy2gIsnYiVo4V9EQethbLdomPxOpBMNMARw81rL1CpO
jbHB7bIDcKs2tQoZEXUW86ZxC8sdaDaWTJTfUO0RpJow6ZO3yvxVIQ==
-----END RSA PRIVATE KEY-----

Some files were not shown because too many files have changed in this diff Show More