Here is how one can setup a nginx to count the https connections made.
Preparation
Create a new folder
mkdir ~/docker_ssl_proxy cd ~/docker_ssl_proxy
Put a dummy entry in your /etc/hosts file
127.0.0.1 YOURDOMAIN.com
Steps
First generate certificate
openssl req -subj '/CN=YOURDOMAIN.com' -x509 -newkey rsa:4096 -nodes -keyout key.pem -out cert.pem -days 365
create a new file something.conf with the following content
server { listen 4000 ssl; ssl_certificate /etc/nginx/conf.d/cert.pem; ssl_certificate_key /etc/nginx/conf.d/key.pem; # access_log /dev/stdout; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; location / { return 200 'With style!'; add_header Content-Type text/plain; } }
Then run the docker with
docker run --rm -v `pwd`/logs:/var/log/nginx -v `pwd`:/etc/nginx/conf.d -p 4000:4000 nginx
Get the cacert
echo quit | openssl s_client -showcerts -servername server -connect YOURDOMAIN.com:4000 > cacert.pem curl --cacert cacert.pem https://YOURDOMAIN.com:4000/ -d 'hello world'
And finally do some connections
go-wrk -c=400 -t=8 -n=10000 -m="POST" -b='{"accountID":"1"}' -i https://YOURDOMAIN.com:4000