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
1 change: 1 addition & 0 deletions extenginx/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ FROM alpine:3.19 AS nginx-runtime-0
RUN apk update && apk upgrade && apk add \
nginx \
nginx-mod-mail \
nginx-mod-stream \
;


Expand Down
4 changes: 4 additions & 0 deletions extenginx/include.d/stream/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# stream block snippets

files with `.conf` extension in this directory will be included in the stream block after
the default events options.
22 changes: 18 additions & 4 deletions extenginx/nginx.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ worker_processes auto;
# Enables the use of JIT for regular expressions to speed-up their processing.
pcre_jit on;

# Configures default error logger.
error_log /var/log/nginx/error.log warn;
# Sends error message (of at least warn level) to stderr.
error_log stderr warn;

# Load dynamic modules.
load_module "modules/ngx_mail_module.so";
load_module "modules/ngx_stream_module.so";


# Include files with config snippets into the root context.
Expand Down Expand Up @@ -83,8 +84,8 @@ http {
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

# Sets the path, format, and configuration for a buffered log write.
access_log /var/log/nginx/access.log main;
# Send logs to stdout using main log format.
access_log /proc/self/fd/1 main;


include /etc/nginx/include.d/http/*.conf;
Expand Down Expand Up @@ -169,3 +170,16 @@ mail {
include /etc/nginx/include.d/server_pop3s/*.conf;
}
}

stream {
# Specifies the main log format.
log_format main '$remote_addr [$time_local] '
'$protocol $status $bytes_sent $bytes_received '
'$session_time "$upstream_addr" '
'"$upstream_bytes_sent" "$upstream_bytes_received" "$upstream_connect_time"';

# Send logs to stdout using main log format.
access_log /proc/self/fd/1 main;

include /etc/nginx/include.d/stream/*.conf;
}