技術筆記 Blog

大數據、容器化、虛擬化、AI 與系統管理技術筆記

View on GitHub

Nginx Reverse Proxy Dockerfile

This repository contains Dockerfile of Nginx for Docker’s automated build published to the public Docker Hub Registry.

Base Docker Image

Installation

  1. Install Docker.

  2. Download automated build from public Docker Hub Registry: docker pull hoycdanny/nginx-reverse-proxy

Usage

    docker run -tdi \ 
      -e PROXY_PASS=https://www.nginx.com \
      -e PROXY_PATH=nginx  \
      -p 80:80 \
      nginx-reverse-proxy

Attach persistent/shared directories.

    docker run -tdi \
      -e PROXY_PASS=PASS_URL \
      -e PROXY_PATH=PASS_PATH \
      -p 80:80 \
      nginx-reverse-proxy

After few seconds open you browser.

curl http://localhost               #nginx welcom page
curl http://localhost/PASS_PATH     #PASS_URL