Sign inSign up

richardjkendall/nginx-rproxy

By richardjkendall

•Updated over 6 years ago

nginx acting as a reverse proxy and taking config from environment variables

Image
0

240

richardjkendall/nginx-rproxy repository overview

⁠nginx-rproxy

This builds on the official nginx-alpine image and adds the ability to accept configuration information via environment variables (using envsbt).

This instance of nginx acts as a reverse proxy, accepting HTTP connections on port 80 and sending them on to a backend service.

On Docker Hub https://hub.docker.com/r/richardjkendall/nginx-rproxy⁠

On GitHub https://github.com/richardjkendall/nginx-rproxy⁠

⁠Configuration

Expects the following environment variables to be defined

VariablePurpose
BACKEND_SCHEMEWhat URL scheme to use for the backend service, typically http or https
BACKEND_HOSTHost name or IP address of the backend service
BACKEND_PORTPort number for the backend service

⁠Running

Example to get this running (runs in the foreground)

docker run --rm \
-e BACKEND_SCHEME=https \ 
-e BACKEND_HOST=backend.service.com \ 
-e BACKEND_PORT=8000 \
-p 8080:80 \ 
richardjkendall/nginx-rproxy

This will run an instance which forwards connections to localhost on port 8080 to https://backend.service.com:8000⁠

Tag summary

Content type

Image

Digest

Size

8.4 MB

Last updated

over 6 years ago

docker pull richardjkendall/nginx-rproxy