DEV Community

jzombie
jzombie

Posted on

Using Docker for a local HTTPS proxy

Sometimes when you're developing locally, you might need to use HTTPS, and might not have that tooling available in your framework of choice.

So I created this small Docker container which essentially creates a self-signed SSL certificate and uses nginx as a reverse proxy to pipe your request to whatever address you want to.

To use:

$ git clone https://github.com/zenOSmosis/docker-dev-ssl-proxy
Enter fullscreen mode Exit fullscreen mode
  • enter the repo directory
$ cd docker-dev-ssl-proxy
Enter fullscreen mode Exit fullscreen mode
$ docker run --net=host -e PROXY_ADDRESS="http://localhost:8080" docker-dev-ssl-proxy
Enter fullscreen mode Exit fullscreen mode

(The address you've defined in PROXY_ADDRESS will be proxied through to https://localhost.)

Note: For production usage, you might want to check out: https://github.com/linuxserver/docker-swag

Top comments (0)