forked from maailma/kansa
-
Notifications
You must be signed in to change notification settings - Fork 0
HTTPS
Steve Huff edited this page Jan 3, 2016
·
1 revision
The development stack expects to be given certificates for HTTPS termination (handled by nginx in front of Tomcat).
-
Edit your local
.env
file to include the following directives:DEFAULT_DOMAIN=worldcon.fi VIRTUAL_HOST=dev.worldcon.fi DEFAULT_HOST=dev.worldcon.fi
-
Run
./gen-ssl-cert.sh
. Accept the defaults at all of the prompts. -
At this point you should have a certificate and a key, in the place where the Docker container expects them to be. Run
docker-compose up
to start the stack. -
For convenience, configure your local hosts file to point
dev.worldcon.fi
to your Docker host IP. Rundocker-machine ip default
to find your Docker host IP, and then modify your hosts file, something like this:DOCKER_HOST_IP=$(docker-machine ip default) \ && echo "${DOCKER_HOST_IP} dev.worldcon.fi" >> /etc/hosts
-
Test connectivity like so:
curl -v -k https://dev.worldcon.fi * Rebuilt URL to: https://dev.worldcon.fi/ * Trying 192.168.99.100... * Connected to dev.worldcon.fi (192.168.99.100) port 443 (#0) * TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 * Server certificate: dev.worldcon.fi > GET / HTTP/1.1 > Host: dev.worldcon.fi > User-Agent: Mozilla/4.0 > Accept: */* > < HTTP/1.1 200 OK < Server: nginx/1.9.6 < Date: Sun, 03 Jan 2016 23:31:46 GMT < Content-Type: text/html;charset=UTF-8 < Content-Length: 22 < Connection: keep-alive < Strict-Transport-Security: max-age=31536000 < * Connection #0 to host dev.worldcon.fi left intact <h1>Hello, world!</h1>