Skip to content

dit4c/dockerfile-nghttpx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dit4c/nghttpx

Very simple nghttpx image.

Python and CA certificates are included for OCSP support.

Example Usage

Reverse-proxy http://mirror.aarnet.edu.au/ on port 81 (h2c):

docker run -i --rm -p 81:3000 dit4c/nghttpx \
  --frontend-no-tls \
  --host-rewrite \
  -b mirror.aarnet.edu.au,80

Reverse-proxy http://mirror.aarnet.edu.au/ on port 443 using self-signed certs:

# Create self-signed certs (elliptic curve)
openssl ecparam -genkey -name prime256v1 -out server.key
openssl req -new -key server.key -out server.csr
openssl req -x509 -days 365 -key server.key -in server.csr -out server.crt
# Run nghttpx
docker run -i --rm -p 443:3000 \
  -v `pwd`:/data:ro \
  dit4c/nghttpx \
  --host-rewrite \
  -b mirror.aarnet.edu.au,80 \
  /data/server.key /data/server.crt

Reverse-proxy container myappserver with exposed port 8080 on port 443 using self-signed certs:

# (Self-signed certs, as above)
# Run nghttpx in background
docker run -d --name myappserver-reverse-proxy \
  -p 443:3000 \
  --link myappserver:backend \
  -v `pwd`:/data:ro \
  dit4c/nghttpx \
  -b backend,8080 \
  /data/server.key /data/server.crt

Check it works using nghttp:

# (Self-signed certs, as above)
# Run nghttpx in background
docker run -ti --rm \
  --link myappserver-reverse-proxy:target \
  --entrypoint /usr/bin/nghttp \
  dit4c/nghttpx \
  -v https://target:3000/