From 5417c7f314257039387d7072f839cf03bcb92587 Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Tue, 12 Dec 2023 18:54:32 +0000 Subject: [PATCH] fix missing port, fix err log level --- conf.d/stream.conf | 14 ++++++++++++++ modules/10_stream.conf | 1 + nginx.conf | 4 ++-- stream/minecraft.conf | 4 ++-- 4 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 conf.d/stream.conf create mode 100644 modules/10_stream.conf diff --git a/conf.d/stream.conf b/conf.d/stream.conf new file mode 100644 index 0000000..4b7177d --- /dev/null +++ b/conf.d/stream.conf @@ -0,0 +1,14 @@ +# /etc/nginx/conf.d/stream.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"'; + + access_log /var/log/nginx/stream.log main; + + # Includes servers configs. + include stream.d/*.conf; +} diff --git a/modules/10_stream.conf b/modules/10_stream.conf new file mode 100644 index 0000000..9b0cbc3 --- /dev/null +++ b/modules/10_stream.conf @@ -0,0 +1 @@ +load_module "modules/ngx_stream_module.so"; diff --git a/nginx.conf b/nginx.conf index 93bf762..13afc34 100644 --- a/nginx.conf +++ b/nginx.conf @@ -43,8 +43,8 @@ stream { '$protocol stat:$status bs:$bytes_sent br:$bytes_received ' st:'$session_time'; access_log access.log basic; - error_log error.log basic; + error_log error.log; # include stream include stream/*.conf; -} \ No newline at end of file +} diff --git a/stream/minecraft.conf b/stream/minecraft.conf index 3c3aa81..3f80eb9 100644 --- a/stream/minecraft.conf +++ b/stream/minecraft.conf @@ -1,5 +1,5 @@ server { listen 25565 reuseport; proxy_timeout 30s; - proxy_pass minecraft.root; -} \ No newline at end of file + proxy_pass minecraft.root:25565; +}