Merge e30771e7fc
into 02396e3b58
This commit is contained in:
commit
f39ddbefcd
4 changed files with 20 additions and 1 deletions
2
Procfile
2
Procfile
|
@ -1,2 +1,2 @@
|
||||||
dockergen: docker-gen -watch -notify "nginx -s reload" /app/nginx.tmpl /etc/nginx/conf.d/default.conf
|
dockergen: docker-gen -watch${INCLUDE_STOPPED} -notify "nginx -s reload" /app/nginx.tmpl /etc/nginx/conf.d/default.conf
|
||||||
nginx: nginx
|
nginx: nginx
|
||||||
|
|
|
@ -176,6 +176,15 @@ If you would like to connect to FastCGI backend, set `VIRTUAL_PROTO=fastcgi` on
|
||||||
|
|
||||||
If you use fastcgi,you can set `VIRTUAL_ROOT=xxx` for your root directory
|
If you use fastcgi,you can set `VIRTUAL_ROOT=xxx` for your root directory
|
||||||
|
|
||||||
|
### Static File Backends
|
||||||
|
|
||||||
|
If you want your container to only serve static content, set `VIRTUAL_PROTO=static` on the container.
|
||||||
|
You can then set `VIRTUAL_ROOT=xxx` to your static files' root directory. If your static files live in a stopped
|
||||||
|
container, be sure to set the `INCLUDE_STOPPED_CONTAINERS=true` environment variable on the nginx-proxy container as
|
||||||
|
stopped containers will otherwise be ignored.
|
||||||
|
|
||||||
|
You can create a minimal docker container with your static website files in a volume. The volume can then be mounted
|
||||||
|
into the nginx-proxy container and be served with this "backend".
|
||||||
|
|
||||||
### Default Host
|
### Default Host
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,12 @@ if [[ $DOCKER_HOST = unix://* ]]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "${INCLUDE_STOPPED_CONTAINERS}" == "true" ]; then
|
||||||
|
export INCLUDE_STOPPED=" -include-stopped"
|
||||||
|
else
|
||||||
|
export INCLUDE_STOPPED=""
|
||||||
|
fi
|
||||||
|
|
||||||
# Generate dhparam file if required
|
# Generate dhparam file if required
|
||||||
/app/generate-dhparam.sh
|
/app/generate-dhparam.sh
|
||||||
|
|
||||||
|
|
|
@ -342,6 +342,8 @@ server {
|
||||||
fastcgi_pass {{ trim $upstream_name }};
|
fastcgi_pass {{ trim $upstream_name }};
|
||||||
{{ else if eq $proto "grpc" }}
|
{{ else if eq $proto "grpc" }}
|
||||||
grpc_pass {{ trim $proto }}://{{ trim $upstream_name }};
|
grpc_pass {{ trim $proto }}://{{ trim $upstream_name }};
|
||||||
|
{{ else if eq $proto "static" }}
|
||||||
|
root {{ trim $vhost_root }};
|
||||||
{{ else }}
|
{{ else }}
|
||||||
proxy_pass {{ trim $proto }}://{{ trim $upstream_name }};
|
proxy_pass {{ trim $proto }}://{{ trim $upstream_name }};
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -394,6 +396,8 @@ server {
|
||||||
fastcgi_pass {{ trim $upstream_name }};
|
fastcgi_pass {{ trim $upstream_name }};
|
||||||
{{ else if eq $proto "grpc" }}
|
{{ else if eq $proto "grpc" }}
|
||||||
grpc_pass {{ trim $proto }}://{{ trim $upstream_name }};
|
grpc_pass {{ trim $proto }}://{{ trim $upstream_name }};
|
||||||
|
{{ else if eq $proto "static" }}
|
||||||
|
root {{ trim $vhost_root }};
|
||||||
{{ else }}
|
{{ else }}
|
||||||
proxy_pass {{ trim $proto }}://{{ trim $upstream_name }};
|
proxy_pass {{ trim $proto }}://{{ trim $upstream_name }};
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Reference in a new issue