-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test vhosts and Travis CI config
- Loading branch information
Showing
8 changed files
with
136 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,4 @@ | |
|
||
.travis.yml export-ignore | ||
/.git* export-ignore | ||
/test export-ignore |
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 |
---|---|---|
|
@@ -2,3 +2,6 @@ | |
/conf.d/*.conf | ||
!/conf.d/.default.conf | ||
!/conf.d/no-ssl.default.conf | ||
/test/* | ||
!/test/vhosts/ | ||
/k6/ |
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,42 @@ | ||
# https://docs.travis-ci.com/ | ||
|
||
services: | ||
- docker | ||
|
||
addons: | ||
hosts: | ||
- server.localhost | ||
- www-server.localhost | ||
- www.server.localhost | ||
- secure.server.localhost | ||
- www.secure.server.localhost | ||
apt: | ||
packages: | ||
- docker-ce | ||
|
||
install: | ||
- curl -sSL https://github.com/loadimpact/k6/releases/download/v0.23.1/k6-v0.23.1-linux64.tar.gz | tar -xz | ||
- mv k6-v0.23.1-linux64 k6 | ||
- curl -sSL https://github.com/h5bp/server-configs-test/releases/download/0.0.4/server-configs-test.tar.gz | tar -xz -C test/ | ||
|
||
before_script: | ||
- docker pull nginx | ||
- | | ||
docker run -d -p 80:80 -p 443:443 --name server \ | ||
-v $TRAVIS_BUILD_DIR/test/fixtures:/var/www/server.localhost \ | ||
-v $TRAVIS_BUILD_DIR/test/vhosts:/etc/nginx/conf.d \ | ||
-v $TRAVIS_BUILD_DIR/test/certs:/etc/nginx/certs \ | ||
-v $TRAVIS_BUILD_DIR/h5bp:/etc/nginx/h5bp \ | ||
-v $TRAVIS_BUILD_DIR/nginx.conf:/etc/nginx/nginx.conf \ | ||
-v $TRAVIS_BUILD_DIR/mime.types:/etc/nginx/mime.types \ | ||
nginx | ||
script: | ||
- ./k6/k6 run test/lib/index.js | ||
- ./k6/k6 run test/lib/precompressed-files-gzip.js | ||
|
||
after_success: ./k6/k6 run test/lib/benchmark.js | ||
|
||
after_failure: | ||
- docker ps -a | ||
- docker logs server |
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,22 @@ | ||
server { | ||
listen [::]:80 default_server deferred; | ||
listen 80 default_server deferred; | ||
|
||
server_name _; | ||
|
||
return 301 https://$host$request_uri; | ||
} | ||
|
||
|
||
server { | ||
listen [::]:443 ssl default_server; | ||
listen 443 ssl default_server; | ||
|
||
server_name _; | ||
|
||
include h5bp/ssl/ssl_engine.conf; | ||
include h5bp/ssl/certificate_files.conf; | ||
include h5bp/ssl/policy_intermediate.conf; | ||
|
||
return 444; | ||
} |
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,30 @@ | ||
server { | ||
listen [::]:443 ssl http2; | ||
listen 443 ssl http2; | ||
|
||
server_name www.secure.server.localhost; | ||
|
||
include h5bp/ssl/ssl_engine.conf; | ||
include h5bp/ssl/certificate_files.conf; | ||
include h5bp/ssl/policy_intermediate.conf; | ||
|
||
return 301 $scheme://secure.server.localhost$request_uri; | ||
} | ||
|
||
server { | ||
listen [::]:443 ssl http2; | ||
listen 443 ssl http2; | ||
|
||
server_name secure.server.localhost; | ||
|
||
include h5bp/ssl/ssl_engine.conf; | ||
include h5bp/ssl/certificate_files.conf; | ||
include h5bp/ssl/policy_intermediate.conf; | ||
|
||
root /var/www/server.localhost; | ||
|
||
include h5bp/basic.conf; | ||
include h5bp/errors/custom_errors.conf; | ||
|
||
include h5bp/security/strict-transport-security.conf; | ||
} |
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,28 @@ | ||
server { | ||
listen [::]:80; | ||
listen 80; | ||
|
||
server_name www.server.localhost; | ||
|
||
return 301 $scheme://server.localhost$request_uri; | ||
} | ||
|
||
server { | ||
listen [::]:80; | ||
listen 80; | ||
|
||
server_name server.localhost; | ||
|
||
root /var/www/server.localhost; | ||
|
||
include h5bp/basic.conf; | ||
|
||
gzip_min_length 1; | ||
|
||
include h5bp/location/web_performance_filename-based_cache_busting.conf; | ||
include h5bp/errors/custom_errors.conf; | ||
|
||
location ~* /test-pre-gzip { | ||
gzip_static on; | ||
} | ||
} |
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,8 @@ | ||
server { | ||
listen [::]:80; | ||
listen 80; | ||
|
||
server_name www-server.localhost; | ||
|
||
return 301 $scheme://www.www-server.localhost$request_uri; | ||
} |