Skip to content

Commit

Permalink
Merge pull request #1 from UKHomeOffice/i
Browse files Browse the repository at this point in the history
Minor improvements
  • Loading branch information
vaijab committed Jul 25, 2016
2 parents 6a7315b + 365997d commit 56fa416
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM alpine:3.4

RUN apk upgrade --no-cache
RUN apk add --no-cache nginx bash
RUN apk upgrade --no-cache && apk add --no-cache nginx bash

ADD bin/run.sh /run.sh
COPY bin/run.sh /run.sh
COPY conf.d /etc/nginx/conf.d

ENTRYPOINT ["/run.sh"]
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ http {
server_name _;
location / {
default_type text/plain;
return 200 "Everything is OK.\n";
}
}
Expand All @@ -42,17 +43,25 @@ EOF

```
export NGINX_CONFIG
docker run -ti --rm -e NGINX_CONFIG quay.io/ukhomeofficedigital/nginx:v0.0.1
docker run -ti --rm -e NGINX_CONFIG quay.io/ukhomeofficedigital/nginx:v0.0.1
```

#### Config file via env variable
You can provide a config file inside a container instead.

```
docker run -ti --rm -e NGINX_CONFIG_FILE=/config/nginx.conf quay.io/ukhomeofficedigital/nginx:v0.0.1
docker run -ti --rm -e NGINX_CONFIG_FILE=/config/nginx.conf quay.io/ukhomeofficedigital/nginx:v0.0.1
```


### Extra Configs

TODO
Extra config snippets can be found in [conf.d](conf.d) directory. You can
include specific files or all by adding the following to the main `nginx.conf`
file:

```
include /etc/nginx/conf.d/logging.conf;
```

20 changes: 20 additions & 0 deletions conf.d/logging.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
log_format extended_json '{'
'"proxy_proto_address": "$proxy_protocol_addr", '
'"remote_addr": "$remote_addr", '
'"http_host": "$host", '
'"remote_user": "$remote_user", '
'"timestamp": "$time_iso8601", '
'"request_uri": "$request_uri", '
'"request_method": "$request_method", '
'"http_status": "$status", '
'"body_bytes_sent": "$body_bytes_sent", '
'"http_referer": "$http_referer", '
'"http_user_agent": "$http_user_agent", '
'"http_x_forwarded_for": "$http_x_forwarded_for", '
'"request_time": "$request_time", '
'"upstream_response_time": "$upstream_response_time", '
'"upstream_addr": "$upstream_addr", '
'"upstream_status": "$upstream_status", '
'"scheme": "$scheme", '
'"gzip_ratio": "$gzip_ratio", '
'}';

0 comments on commit 56fa416

Please sign in to comment.