-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
8 changed files
with
193 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
services: | ||
sut: | ||
image: nginxproxy/nginx-proxy:test | ||
volumes: | ||
- /var/run/docker.sock:/tmp/docker.sock:ro | ||
- ./withdefault.certs:/etc/nginx/certs:ro | ||
environment: | ||
HTTPS_METHOD: redirect | ||
https-only: | ||
image: web | ||
expose: | ||
- "82" | ||
environment: | ||
WEB_PORTS: "82" | ||
HTTPS_METHOD: nohttp | ||
VIRTUAL_HOST: https-only.nginx-proxy.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
services: | ||
sut: | ||
image: nginxproxy/nginx-proxy:test | ||
volumes: | ||
- /var/run/docker.sock:/tmp/docker.sock:ro | ||
- ./withdefault.certs:/etc/nginx/certs:ro | ||
environment: | ||
HTTPS_METHOD: nohttp | ||
https-only: | ||
image: web | ||
expose: | ||
- "82" | ||
environment: | ||
WEB_PORTS: "82" | ||
VIRTUAL_HOST: https-only.nginx-proxy.test | ||
missing-cert: | ||
image: web | ||
expose: | ||
- "84" | ||
environment: | ||
WEB_PORTS: "84" | ||
VIRTUAL_HOST: missing-cert.nginx-proxy.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
services: | ||
sut: | ||
image: nginxproxy/nginx-proxy:test | ||
volumes: | ||
- /var/run/docker.sock:/tmp/docker.sock:ro | ||
- ./withdefault.certs:/etc/nginx/certs:ro | ||
environment: | ||
HTTPS_METHOD: nohttp | ||
https-only: | ||
image: web | ||
expose: | ||
- "82" | ||
environment: | ||
WEB_PORTS: "82" | ||
VIRTUAL_HOST: https-only.nginx-proxy.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
services: | ||
sut: | ||
image: nginxproxy/nginx-proxy:test | ||
volumes: | ||
- /var/run/docker.sock:/tmp/docker.sock:ro | ||
environment: | ||
HTTPS_METHOD: redirect | ||
http-only: | ||
image: web | ||
expose: | ||
- "83" | ||
environment: | ||
WEB_PORTS: "83" | ||
HTTPS_METHOD: nohttps | ||
VIRTUAL_HOST: http-only.nginx-proxy.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
services: | ||
sut: | ||
image: nginxproxy/nginx-proxy:test | ||
volumes: | ||
- /var/run/docker.sock:/tmp/docker.sock:ro | ||
environment: | ||
HTTPS_METHOD: nohttps | ||
http-only: | ||
image: web | ||
expose: | ||
- "83" | ||
environment: | ||
WEB_PORTS: "83" | ||
VIRTUAL_HOST: http-only.nginx-proxy.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters