Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

Commit

Permalink
nginx log format
Browse files Browse the repository at this point in the history
  • Loading branch information
procrastinatio committed Apr 17, 2020
1 parent dd42497 commit 1a6c1d1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dev.env
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ PRINT_TEMP_DIR=/var/local/print
PRINT_LOGLEVEL=10
DEBUG=True
CATALINA_OPTS=2g
NGINX_LOG_LEVEL=debug
NGINX_LOG_LEVEL=warn
NGINX_WORKERS=8
1 change: 1 addition & 0 deletions nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get remove -y nginx && apt-get install -y gettext bash nginx-full
RUN rm /etc/nginx/nginx.conf /etc/nginx/conf.d/default.conf
COPY . /.
COPY log_format.conf /etc/nginx/log_format.conf
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]
4 changes: 4 additions & 0 deletions nginx/log_format.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# log_format postdata $request_body;
log_format postdata '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$request_body" "$http_user_agent"';
7 changes: 4 additions & 3 deletions nginx/nginx.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ events {
http {
# if we use analytics we may want to turn that off
# log_format postdata $request_body;
log_format postdata '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" "$request_body"';
# use include because impossible to escape correctly

include log_format.conf;

access_log /dev/stdout combined;
sendfile off;

Expand Down

0 comments on commit 1a6c1d1

Please sign in to comment.