Skip to content

Commit 7fca0c4

Browse files
authored
Merge pull request #25 from andrewshan/main
feat: 重定向到stdout
2 parents b7e911f + bec8641 commit 7fca0c4

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ RUN set -ex \
3737
&& ./configure --prefix=/etc/nginx --add-module=../../source/nginx_polaris_limit_module --add-module=../polaris_client --with-stream --with-cpp=g++ \
3838
&& make \
3939
&& make install \
40-
&& ln -s /etc/nginx/sbin/nginx /usr/local/bin/nginx
40+
&& ln -sf /etc/nginx/sbin/nginx /usr/local/bin/nginx \
41+
&& ln -sf /dev/stdout /var/log/nginx/access.log \
42+
&& ln -sf /dev/stderr /var/log/nginx/error.log
4143

4244
CMD ["nginx", "-g", "daemon off;", "-c", "/etc/nginx/conf/nginx.conf"]

third_party/nginx/nginx.conf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ worker_processes 1;
44

55
#error_log logs/error.log;
66
#error_log logs/error.log notice;
7-
#error_log logs/error.log info;
7+
error_log /var/log/nginx/error.log info;
88

99
#pid logs/nginx.pid;
1010

@@ -18,11 +18,11 @@ http {
1818
include mime.types;
1919
default_type application/octet-stream;
2020

21-
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
22-
# '$status $body_bytes_sent "$http_referer" '
23-
# '"$http_user_agent" "$http_x_forwarded_for"';
21+
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
22+
'$status $body_bytes_sent "$http_referer" '
23+
'"$http_user_agent" "$http_x_forwarded_for"';
2424

25-
#access_log logs/access.log main;
25+
access_log /var/log/nginx/access.log main;
2626

2727
sendfile on;
2828
#tcp_nopush on;

0 commit comments

Comments
 (0)