Added information about running nginx in debug mode
https://github.com/nginxinc/docker-nginx/issues/55
This commit is contained in:
parent
393bd43797
commit
b9cb1b7403
|
|
@ -72,7 +72,8 @@ Out-of-the-box, Nginx doesn't support using environment variables inside most co
|
||||||
|
|
||||||
Here is an example using docker-compose.yml:
|
Here is an example using docker-compose.yml:
|
||||||
|
|
||||||
```web:
|
```
|
||||||
|
web:
|
||||||
image: nginx
|
image: nginx
|
||||||
volumes:
|
volumes:
|
||||||
- ./mysite.template:/etc/nginx/conf.d/mysite.template
|
- ./mysite.template:/etc/nginx/conf.d/mysite.template
|
||||||
|
|
@ -84,7 +85,27 @@ Here is an example using docker-compose.yml:
|
||||||
command: /bin/bash -c "envsubst < /etc/nginx/conf.d/mysite.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
|
command: /bin/bash -c "envsubst < /etc/nginx/conf.d/mysite.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
|
||||||
```
|
```
|
||||||
|
|
||||||
The `mysite.template` file may then contain variable references like this :
|
The `mysite.template` file may then contain variable references like this:
|
||||||
|
|
||||||
`listen ${NGINX_PORT};
|
`listen ${NGINX_PORT};
|
||||||
`
|
`
|
||||||
|
|
||||||
|
## running nginx in debug mode
|
||||||
|
|
||||||
|
Images since version 1.9.8 come with `nginx-debug` binary that produces
|
||||||
|
complete output when using higher verbosity log levels. It can be used
|
||||||
|
with simple CMD substitution:
|
||||||
|
|
||||||
|
```console
|
||||||
|
docker run --name my-nginx -v /host/path/nginx.conf:/etc/nginx/nginx.conf:ro -d nginx nginx-debug -g 'daemon off;'
|
||||||
|
```
|
||||||
|
|
||||||
|
Similar configuration in docker-compose.yml may look like this:
|
||||||
|
|
||||||
|
```
|
||||||
|
web:
|
||||||
|
image: nginx
|
||||||
|
volumes:
|
||||||
|
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
||||||
|
command: [nginx-debug, '-g', 'daemon off;']
|
||||||
|
```
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue