nginx proxy

reverse-proxy

docker run \
    --name reverse-proxy \
    -v /docker/nginx/certs:/etc/nginx/certs:ro \
    -v /docker/nginx/vhost.d:/etc/nginx/vhost.d \
    -v /docker/nginx/html:/usr/share/nginx/html \
    -v /docker/nginx/conf.d:/etc/nginx/conf.d \
    -v /var/run/docker.sock:/tmp/docker.sock:ro \
    --label nginx_proxy=true \
    -p 80:80 \
    -p 443:443 \
    -d \
    --restart unless-stopped \
    --network ServerFarm \
    jwilder/nginx-proxy

nginx site

docker run \
    --name www \
    -e 'VIRTUAL_HOST=www.kawsing.org' \
    -d \
    --restart unless-stopped \
    --network ServerFarm \
    nginx:alpine

於之前的 docker dns server 建立正解檔

docker run \
    --name www2 \
    -e 'VIRTUAL_HOST=www2.kawsing.org' \
    -d \
    --restart unless-stopped \
    --network ServerFarm \
    nginx:alpine

Last updated