Skip to content

Commit 5b4f04c

Browse files
Add NGINX_ERROR_LOG and NGINX_ACCESS_LOG. (#534)
Co-authored-by: Jay Rogers <[email protected]>
1 parent f868e0a commit 5b4f04c

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

docs/content/docs/7.reference/1.environment-variable-specification.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ We like to customize our images on a per app basis using environment variables.
5353
`FRANKENPHP_CONFIG`<br />*Default: ""*|Set the configuration for FrankenPHP. (<a target="_blank" href="https://frankenphp.dev/docs/config/#caddyfile-config">Official docs</a>)|frankenphp
5454
`HEALTHCHECK_PATH`<br />*Default: "/healthcheck"*|Set the path for the health check endpoint. (<a target="_blank" href="https://docs.docker.com/engine/reference/builder/#healthcheck">Official docs</a>)|all (except `cli` and `frankenphp`)
5555
`LOG_OUTPUT_LEVEL`<br />*Default: "warn"*|Set your container output different verbosity levels: debug, info, off |all
56+
`NGINX_ACCESS_LOG`<br />*Default: "/dev/stdout"*|Set the default output stream for access log.|fpm-nginx
57+
`NGINX_ERROR_LOG`<br />*Default: "/dev/stderr"*|Set the default output stream for error log.|fpm-nginx
5658
`NGINX_FASTCGI_BUFFERS`<br />*Default: "8 8k"*|Sets the number and size of the buffers used for reading a response from a FastCGI server. (<a target="_blank" href="https://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_buffers">Official Docs</a>)|fpm-nginx
5759
`NGINX_FASTCGI_BUFFER_SIZE`<br />*Default: "8k"*|Sets the size of the buffer used for reading a response from a FastCGI server. (<a target="_blank" href="https://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_buffer_size">Official Docs</a>)|fpm-nginx
5860
`NGINX_SERVER_TOKENS`<br />*Default: "off"*|Display NGINX version in responses. (<a target="_blank" href="https://nginx.org/en/docs/http/ngx_http_core_module.html#server_tokens">Official Docs</a>)|fpm-nginx

src/variations/fpm-nginx/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ ENV APP_BASE_DIR=/var/www/html \
120120
DISABLE_DEFAULT_CONFIG=false \
121121
LOG_OUTPUT_LEVEL=warn \
122122
HEALTHCHECK_PATH="/healthcheck" \
123+
NGINX_ACCESS_LOG="/dev/stdout" \
124+
NGINX_ERROR_LOG="/dev/stderr" \
123125
NGINX_FASTCGI_BUFFERS="8 8k" \
124126
NGINX_FASTCGI_BUFFER_SIZE="8k" \
125127
NGINX_SERVER_TOKENS=off \

src/variations/fpm-nginx/etc/nginx/nginx.conf.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
worker_processes auto;
22

3-
error_log /dev/stderr $LOG_OUTPUT_LEVEL;
3+
error_log $NGINX_ERROR_LOG $LOG_OUTPUT_LEVEL;
44
pid /var/run/nginx.pid;
55
daemon off;
66

@@ -25,7 +25,7 @@ http {
2525
default 1;
2626
}
2727

28-
access_log /dev/stdout main if=$loggable;
28+
access_log $NGINX_ACCESS_LOG main if=$loggable;
2929

3030
sendfile on;
3131
#tcp_nopush on;

0 commit comments

Comments
 (0)