From bec8641e319810c97e1b60a5be2fec42a3b8e2ca Mon Sep 17 00:00:00 2001 From: andrewshan Date: Thu, 1 Sep 2022 17:16:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=87=8D=E5=AE=9A=E5=90=91=E5=88=B0std?= =?UTF-8?q?out?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 4 +++- third_party/nginx/nginx.conf | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1ced53d..4842559 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,6 +37,8 @@ RUN set -ex \ && ./configure --prefix=/etc/nginx --add-module=../../source/nginx_polaris_limit_module --add-module=../polaris_client --with-stream --with-cpp=g++ \ && make \ && make install \ - && ln -s /etc/nginx/sbin/nginx /usr/local/bin/nginx + && ln -sf /etc/nginx/sbin/nginx /usr/local/bin/nginx \ + && ln -sf /dev/stdout /var/log/nginx/access.log \ + && ln -sf /dev/stderr /var/log/nginx/error.log CMD ["nginx", "-g", "daemon off;", "-c", "/etc/nginx/conf/nginx.conf"] \ No newline at end of file diff --git a/third_party/nginx/nginx.conf b/third_party/nginx/nginx.conf index 20c2d1c..cb8af1f 100644 --- a/third_party/nginx/nginx.conf +++ b/third_party/nginx/nginx.conf @@ -4,7 +4,7 @@ worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; -#error_log logs/error.log info; +error_log /var/log/nginx/error.log info; #pid logs/nginx.pid; @@ -18,11 +18,11 @@ http { include mime.types; default_type application/octet-stream; - #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - # '$status $body_bytes_sent "$http_referer" ' - # '"$http_user_agent" "$http_x_forwarded_for"'; + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; - #access_log logs/access.log main; + access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on;