diff --git a/system-tests/docker-test-env/docker-compose.yml b/system-tests/docker-test-env/docker-compose.yml index 0c8ac84708..7823df7b7f 100644 --- a/system-tests/docker-test-env/docker-compose.yml +++ b/system-tests/docker-test-env/docker-compose.yml @@ -1,17 +1,18 @@ version: '3' services: - - httpd-01: - image: httpd:2.4 + origin: + image: nginx:stable-alpine ports: - - "8081:80" + - "9091:8080" + - "9443:8443" volumes: - - ./apache-config:/usr/local/apache2/htdocs/ + - ./nginx:/etc/nginx/ + - ./origin-data:/data/stub-01 toxiproxy: image: shopify/toxiproxy:latest depends_on: - - httpd-01 + - origin ports: - "8474:8474" volumes: @@ -24,7 +25,7 @@ services: styx: image: styxcore:latest depends_on: - - httpd-01 + - origin - toxiproxy ports: - "9000:9000" @@ -34,9 +35,6 @@ services: volumes: - ./styx-config:/styx/config - ./styx-logs:/styx/logs - links: - - httpd-01 - - toxiproxy environment: - JVM_DEBUG=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:8000 diff --git a/system-tests/docker-test-env/nginx/nginx.conf b/system-tests/docker-test-env/nginx/nginx.conf new file mode 100644 index 0000000000..2eb9d9dc4c --- /dev/null +++ b/system-tests/docker-test-env/nginx/nginx.conf @@ -0,0 +1,14 @@ +events { + worker_connections 1024; +} + +http { + server { + listen 8080; + listen 8443 ssl; + root /data/stub-01; + + ssl_certificate /etc/nginx/testCredentials.crt; + ssl_certificate_key /etc/nginx/testCredentials.key; + } +} diff --git a/system-tests/docker-test-env/nginx/testCredentials.crt b/system-tests/docker-test-env/nginx/testCredentials.crt new file mode 100644 index 0000000000..7f8e1118b3 --- /dev/null +++ b/system-tests/docker-test-env/nginx/testCredentials.crt @@ -0,0 +1,22 @@ +-----BEGIN CERTIFICATE----- +MIIDtTCCAp2gAwIBAgIJANrUnYlczTcjMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV +BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX +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1VvdTnXbK6WGlaSfMjysGsnJozn8ZAqd6fQWzIxW2DSiSf8inc4VlIb +AqW6dcH+Mu/kmnEJtTCFo3KXwzmvq629BacIDZXUjgS+2q28RQ/s8iU= +-----END CERTIFICATE----- diff --git a/system-tests/docker-test-env/nginx/testCredentials.key b/system-tests/docker-test-env/nginx/testCredentials.key new file mode 100644 index 0000000000..bda8c40ad6 --- /dev/null +++ b/system-tests/docker-test-env/nginx/testCredentials.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDKMsmtWozaqeMT +jM/SQ1mz/H5wS4ZTxNyGRVNu7GtHSlJjHF1g9xTMs45/AvaCVxjTeXircea0IFHp +zlKIzZVhu072vi+jt+ulZclwoNjYndE7JBf4RPeb1TdPbPYvjupKU+Ap/TccU3Yg +qvUJFa6LyejKk29Dp1b1iq/8UEFuV0btuBLkMpk05ENIU6kUVc/tzq3RZY0wnUaH +ZhnrMmrXPrSCdXkd1zK2gR4UvTYTYabBxgspiL+HRvMRvDMpIIC4uOURGMPASi2n +6tDc2nwJ6C/dP7ravS+cJpa1xH1uCjD/pxA86O4ubj08aHxecMEwOSOa+ketOXeL +gCrvYh05AgMBAAECggEATflB7tkBgn2LNQnTRtl0KUWQmMt3NKyxAhKP9zGyuR4/ +ITtaAz+lRL9ljzNcTq05xKuOTkcxWXsxO4G2ME1fcv3hmKOFCZSuiezzvrw4g2hw +vGbR24r1FaImnzl8wqBRV3J6+pZMf17sKfLjZap30i592Ej82lEY5r2h2iI06VCN +bDOonY6lQ1C+5a/sO6yRRHGdWqi/ppOn9Rh5orp6z5F+Ew+6sBeg3CKCZA4y8izL +xy+Jgseh/UFNoTVFizd1Dnvj5e6fatTlyJiSuA7dSztq0dQ31Whe8JgqTJ2xMEFt +sxSzG3pZZrhNV+4l96l975w/XWK8c7/JdrTnhgJqVQKBgQDmGIQ575JsQ5JS/FLv +spOJes5j7167dCkQXJNN6/Jc+muLq+YZLY9Xk6d2VccReum9qYYDPbwn3W1fJULU +NAi5DKvRpRjKbrCCRNQdZDQpxE2EipFdTJCCIYk4q4s7S/nAX3rzH4oUywxejwb0 +/Bse2m4l/zSDEyHlAZhu3oBNtwKBgQDg9kD/TaFFd19OqwIXqQA6JFPOtPCP11go +bJlqps8yetcX5Wv+z0k77MFroeeJTuvpqYMxHTV5dXKX8J42yhf4O6K70yHNcZsf +M5QHXdn/eSpqMtqswC5laKJNKqXeGxv1H36izPLcaov6ICRWl8CS+lpkhELeF7l1 +R6+I0n7sjwKBgQDYDx9iU56XgJ/OwtaR84psZt+UoXm/5aSFk5hSbAMJ4a/I2GJZ +NBnMb36pNISX2mXPzXZkZrzeZiLEW/Wz0yR5tvdEBZYQx/2AZWcULjp5GbZ8ha1Y +AYQUXa8/gn1b8cyUIlQOJYiAW+XCiOVMd8pzn0Ic9dX2WqnSIzxipxWtYwKBgQCm +S6NUltBGh62+e496agWu9Te2r+68hhW3HEB0pIa57DCgi4m/vP+H+sYoiHCeAedG +vXYrkkn7VSS2yLpMCiyZ5YuwiKyOMBLZh8k/gNMrlSgThTA9T3t8n1KK9KHUg/mw +w+1a72IAKgr7hVMXZ+qFO+giMds0ThlcZveNjv0gZQKBgCOjIc/7Z1DV5Nvto8Aj +RoLV8FEDf1RBO5oUZH/QJpumpnw2cZk2MDvj9dVf6ccqe/gV4pL3jIzTX6+s15YM +hQF6awc9uwjZ4SVeij5kTL4MygW/vCbAYZgwREQBSqoNN43suoI1laV32fNuMzDK +2tw75OPgFv6YA7+223TyWVIT +-----END PRIVATE KEY----- diff --git a/system-tests/docker-test-env/apache-config/info.txt b/system-tests/docker-test-env/origin-data/hello.txt similarity index 100% rename from system-tests/docker-test-env/apache-config/info.txt rename to system-tests/docker-test-env/origin-data/hello.txt diff --git a/system-tests/docker-test-env/origin-data/index.html b/system-tests/docker-test-env/origin-data/index.html new file mode 100644 index 0000000000..ace0ccbc20 --- /dev/null +++ b/system-tests/docker-test-env/origin-data/index.html @@ -0,0 +1,2 @@ +

Hello, world!

+

ABC

diff --git a/system-tests/docker-test-env/styx-config/origins.yml b/system-tests/docker-test-env/styx-config/origins.yml index 4685f40874..d3d956d395 100644 --- a/system-tests/docker-test-env/styx-config/origins.yml +++ b/system-tests/docker-test-env/styx-config/origins.yml @@ -4,10 +4,10 @@ # and applies any changes straight away. # --- -- id: "httpd" +- id: "origin" path: "/" healthCheck: - uri: /info.txt + uri: /hello.txt connectionPool: maxConnectionsPerHost: 45 maxPendingConnectionsPerHost: 15 @@ -15,4 +15,35 @@ pendingConnectionTimeoutMillis: 8000 responseTimeoutMillis: 60000 origins: - - { id: "httpd-01", host: "toxiproxy:80" } + - { id: "origin-01", host: "origin:8080" } + +- id: "secure-origin" + path: "/secure" + healthCheck: + uri: /hello.txt + tlsSettings: + trustAllCerts: true + connectionPool: + maxConnectionsPerHost: 45 + maxPendingConnectionsPerHost: 15 + connectTimeoutMillis: 1000 + pendingConnectionTimeoutMillis: 8000 + responseTimeoutMillis: 60000 + rewrites: + - urlPattern: "/secure/(.*)" + replacement: "/$1" + origins: + - { id: "secure-origin", host: "origin:8443" } + +- id: "toxiproxy" + path: "/toxi" + healthCheck: + uri: /hello.txt + connectionPool: + maxConnectionsPerHost: 45 + maxPendingConnectionsPerHost: 15 + connectTimeoutMillis: 1000 + pendingConnectionTimeoutMillis: 8000 + responseTimeoutMillis: 60000 + origins: + - { id: "toxiproxy-01", host: "toxiproxy:8080" } diff --git a/system-tests/docker-test-env/toxiproxy/config.json b/system-tests/docker-test-env/toxiproxy/config.json index 463a2d5804..e2c62c06ce 100644 --- a/system-tests/docker-test-env/toxiproxy/config.json +++ b/system-tests/docker-test-env/toxiproxy/config.json @@ -1,7 +1,7 @@ [ { - "name": "httpd-01", - "listen": "0.0.0.0:80", - "upstream": "httpd-01:80" + "name": "origin-01", + "listen": "0.0.0.0:8080", + "upstream": "origin:8080" } ]