Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions docker_openresty/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,37 @@ You can add your custom configuration snippet files at /data/nginx/custom as fol
- `conf/server_stream_tcp.conf`: Included at the end of every TCP stream server block
- `conf/server_stream_udp.conf`: Included at the end of every UDP stream server block
- `/data/nginx/custom/server_dead.conf`: Included at the end of every 404 server block
-

## Log fields mappings

| JSON key | standard | proxy | stream |
| -------- | ------------------------- | ------------------------- | -------------------------- |
| `T` | `$fmt_localtime` | `$fmt_localtime` | `$fmt_localtime` |
| `t` | `$request_time` | `$request_time` | — |
| `tr` | `$upstream_response_time` | `$upstream_response_time` | — |
| `ts` | — | — | `$session_time` |
| `tc` | — | — | `$upstream_connect_time` |
| `s` | `$status` | `$status` | `$status` |
| `r` | `$remote_addr` | `$remote_addr` | `$remote_addr` |
| `m` | `$request_method` | `$request_method` | — |
| `e` | `$scheme` | `$scheme` | — |
| `h` | `$host` | `$host` | — |
| `u` | `$request_uri` | `$request_uri` | — |
| `R` | `$http_x_forwarded_for` | `$http_x_forwarded_for` | — |
| `L` | `$body_bytes_sent` | `$body_bytes_sent` | — |
| `G` | `$gzip_ratio` | `$gzip_ratio` | — |
| `a` | `$http_user_agent` | `$http_user_agent` | — |
| `f` | `$http_referer` | `$http_referer` | — |
| `U` | — | `$upstream_status` | — |
| `C` | — | `$upstream_cache_status` | — |
| `S` | — | `$server_name` | — |
| `P` | — | — | `$protocol` |
| `p` | — | — | `$remote_port` |
| `bs` | — | — | `$bytes_sent` |
| `br` | — | — | `$bytes_received` |
| `ua` | — | — | `$upstream_addr` |
| `ubs` | — | — | `$upstream_bytes_sent` |
| `ubr` | — | — | `$upstream_bytes_received` |
| `ssl_p` | — | — | `$ssl_protocol` |
| `ssl_c` | — | — | `$ssl_cipher` |
4 changes: 2 additions & 2 deletions docker_openresty/work/nginx/conf.d/include/cache.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
# ignore these headers for media
proxy_ignore_headers Set-Cookie Cache-Control Expires X-Accel-Expires;

# cache 200s and also 404s (not ideal but there are a few 404 images for some reason)
proxy_cache_valid any 30m;
# cache 200s for 30 minutes and cache 404s for 1 minute
proxy_cache_valid 200 206 30m;
proxy_cache_valid 404 1m;

# strip this header to avoid If-Modified-Since requests
Expand Down
32 changes: 0 additions & 32 deletions docker_openresty/work/nginx/conf.d/include/log-standard.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,3 @@ log_format standard escape=json '{"T":"$fmt_localtime","t":"$request_time","tr":
log_format proxy escape=json '{"T":"$fmt_localtime","t":"$request_time","tr":"$upstream_response_time","s":"$status","r":"$remote_addr","m":"$request_method","e":"$scheme","h":"$host","u":"$request_uri","R":"$http_x_forwarded_for","L":"$body_bytes_sent","G":"$gzip_ratio","a":"$http_user_agent","f":"$http_referer","U":"$upstream_status","C":"$upstream_cache_status","S":"$server_name"}';

access_log /var/log/nginx/fallback_access.log proxy;

## Log formats:
#| JSON key | standard | proxy | stream |
#| -------- | ------------------------- | ------------------------- | -------------------------- |
#| `T` | `$fmt_localtime` | `$fmt_localtime` | `$fmt_localtime` |
#| `t` | `$request_time` | `$request_time` | — |
#| `tr` | `$upstream_response_time` | `$upstream_response_time` | — |
#| `ts` | — | — | `$session_time` |
#| `tc` | — | — | `$upstream_connect_time` |
#| `s` | `$status` | `$status` | `$status` |
#| `r` | `$remote_addr` | `$remote_addr` | `$remote_addr` |
#| `m` | `$request_method` | `$request_method` | — |
#| `e` | `$scheme` | `$scheme` | — |
#| `h` | `$host` | `$host` | — |
#| `u` | `$request_uri` | `$request_uri` | — |
#| `R` | `$http_x_forwarded_for` | `$http_x_forwarded_for` | — |
#| `L` | `$body_bytes_sent` | `$body_bytes_sent` | — |
#| `G` | `$gzip_ratio` | `$gzip_ratio` | — |
#| `a` | `$http_user_agent` | `$http_user_agent` | — |
#| `f` | `$http_referer` | `$http_referer` | — |
#| `U` | — | `$upstream_status` | — |
#| `C` | — | `$upstream_cache_status` | — |
#| `S` | — | `$server_name` | — |
#| `P` | — | — | `$protocol` |
#| `p` | — | — | `$remote_port` |
#| `bs` | — | — | `$bytes_sent` |
#| `br` | — | — | `$bytes_received` |
#| `ua` | — | — | `$upstream_addr` |
#| `ubs` | — | — | `$upstream_bytes_sent` |
#| `ubr` | — | — | `$upstream_bytes_received` |
#| `ssl_p` | — | — | `$ssl_protocol` |
#| `ssl_c` | — | — | `$ssl_cipher` |
32 changes: 0 additions & 32 deletions docker_openresty/work/nginx/conf.d/include/log-stream.conf
Original file line number Diff line number Diff line change
@@ -1,35 +1,3 @@
log_format stream escape=json '{"T":"$fmt_localtime","ts":"$session_time","tc":"$upstream_connect_time","s":"$status","r":"$remote_addr","P":"$protocol","p":"$remote_port","bs":"$bytes_sent","br":"$bytes_received","ua":"$upstream_addr","ubs":"$upstream_bytes_sent","ubr":"$upstream_bytes_received","ssl_p":"$ssl_protocol","ssl_c":"$ssl_cipher"}';

access_log /var/log/nginx/fallback_stream_access.log stream;

## Log formats:
#| JSON key | standard | proxy | stream |
#| -------- | ------------------------- | ------------------------- | -------------------------- |
#| `T` | `$fmt_localtime` | `$fmt_localtime` | `$fmt_localtime` |
#| `t` | `$request_time` | `$request_time` | — |
#| `tr` | `$upstream_response_time` | `$upstream_response_time` | — |
#| `ts` | — | — | `$session_time` |
#| `tc` | — | — | `$upstream_connect_time` |
#| `s` | `$status` | `$status` | `$status` |
#| `r` | `$remote_addr` | `$remote_addr` | `$remote_addr` |
#| `m` | `$request_method` | `$request_method` | — |
#| `e` | `$scheme` | `$scheme` | — |
#| `h` | `$host` | `$host` | — |
#| `u` | `$request_uri` | `$request_uri` | — |
#| `R` | `$http_x_forwarded_for` | `$http_x_forwarded_for` | — |
#| `L` | `$body_bytes_sent` | `$body_bytes_sent` | — |
#| `G` | `$gzip_ratio` | `$gzip_ratio` | — |
#| `a` | `$http_user_agent` | `$http_user_agent` | — |
#| `f` | `$http_referer` | `$http_referer` | — |
#| `U` | — | `$upstream_status` | — |
#| `C` | — | `$upstream_cache_status` | — |
#| `S` | — | `$server_name` | — |
#| `P` | — | — | `$protocol` |
#| `p` | — | — | `$remote_port` |
#| `bs` | — | — | `$bytes_sent` |
#| `br` | — | — | `$bytes_received` |
#| `ua` | — | — | `$upstream_addr` |
#| `ubs` | — | — | `$upstream_bytes_sent` |
#| `ubr` | — | — | `$upstream_bytes_received` |
#| `ssl_p` | — | — | `$ssl_protocol` |
#| `ssl_c` | — | — | `$ssl_cipher` |