forked from nginx-proxy/nginx-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into ssl-modern
- Loading branch information
Showing
8 changed files
with
68 additions
and
6 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
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
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,19 @@ | ||
import pytest | ||
|
||
|
||
def test_web1_HSTS_default(docker_compose, nginxproxy): | ||
r = nginxproxy.get("https://web1.nginx-proxy.tld/port", allow_redirects=False) | ||
assert "answer from port 81\n" in r.text | ||
assert "Strict-Transport-Security" in r.headers | ||
assert "max-age=31536000" == r.headers["Strict-Transport-Security"] | ||
|
||
def test_web2_HSTS_off(docker_compose, nginxproxy): | ||
r = nginxproxy.get("https://web2.nginx-proxy.tld/port", allow_redirects=False) | ||
assert "answer from port 81\n" in r.text | ||
assert "Strict-Transport-Security" not in r.headers | ||
|
||
def test_web3_HSTS_custom(docker_compose, nginxproxy): | ||
r = nginxproxy.get("https://web3.nginx-proxy.tld/port", allow_redirects=False) | ||
assert "answer from port 81\n" in r.text | ||
assert "Strict-Transport-Security" in r.headers | ||
assert "max-age=86400; includeSubDomains; preload" == r.headers["Strict-Transport-Security"] |
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,32 @@ | ||
web1: | ||
image: web | ||
expose: | ||
- "81" | ||
environment: | ||
WEB_PORTS: "81" | ||
VIRTUAL_HOST: "web1.nginx-proxy.tld" | ||
|
||
web2: | ||
image: web | ||
expose: | ||
- "81" | ||
environment: | ||
WEB_PORTS: "81" | ||
VIRTUAL_HOST: "web2.nginx-proxy.tld" | ||
HSTS: "off" | ||
|
||
web3: | ||
image: web | ||
expose: | ||
- "81" | ||
environment: | ||
WEB_PORTS: "81" | ||
VIRTUAL_HOST: "web3.nginx-proxy.tld" | ||
HSTS: "max-age=86400; includeSubDomains; preload" | ||
|
||
sut: | ||
image: jwilder/nginx-proxy:test | ||
volumes: | ||
- /var/run/docker.sock:/tmp/docker.sock:ro | ||
- ../lib/ssl/dhparam.pem:/etc/nginx/dhparam/dhparam.pem:ro | ||
- ./certs:/etc/nginx/certs:ro |
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