From 91e024741ad00dc6a73a5aec0aaca67ad60236da Mon Sep 17 00:00:00 2001 From: Faustin Lammler Date: Tue, 15 Oct 2024 16:41:39 +0200 Subject: [PATCH] Split nginx logs for better debug --- docker-compose/generate-config.py | 3 --- .../nginx/templates/bb.conf.template | 27 ++++++++++--------- .../nginx/templates/ci.conf.template | 6 ++++- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/docker-compose/generate-config.py b/docker-compose/generate-config.py index 35c9f3b7..faff553a 100755 --- a/docker-compose/generate-config.py +++ b/docker-compose/generate-config.py @@ -127,9 +127,6 @@ - crossbar """ -END_TEMPLATE = """ -""" - # Function to generate volumes section for Docker Compose def generate_volumes(volumes, indent_level=2): diff --git a/docker-compose/nginx/templates/bb.conf.template b/docker-compose/nginx/templates/bb.conf.template index 521e6802..306cb7ab 100644 --- a/docker-compose/nginx/templates/bb.conf.template +++ b/docker-compose/nginx/templates/bb.conf.template @@ -63,18 +63,6 @@ server { proxy_pass http://127.0.0.1:8010; } - # disable logging for wsgi_dashboards/styles.css since it's generated - # somewhere and mess with fail2ban //TEMP find the root cause! - location ~ /wsgi_dashboards/styles.css* { - access_log off; - } - location = /favicon.ico { - access_log off; - } - location = /robots.txt { - access_log off; - } - # Server sent event (sse) settings location /sse { proxy_buffering off; @@ -96,4 +84,19 @@ server { alias /srv/cr/static; } + # logging + access_log /var/log/nginx/${NGINX_BUILDBOT_VHOST}.access.log; + error_log /var/log/nginx/${NGINX_BUILDBOT_VHOST}.error.log; + + # disable logging for wsgi_dashboards/styles.css since it's generated + # somewhere and mess with fail2ban //TEMP find the root cause! + location ~ /wsgi_dashboards/styles.css* { + access_log off; + } + location = /favicon.ico { + access_log off; + } + location = /robots.txt { + access_log off; + } } diff --git a/docker-compose/nginx/templates/ci.conf.template b/docker-compose/nginx/templates/ci.conf.template index 007ec1ce..f88d79ac 100644 --- a/docker-compose/nginx/templates/ci.conf.template +++ b/docker-compose/nginx/templates/ci.conf.template @@ -63,7 +63,7 @@ server { msie_padding off; # Enable gzipped format - #gzip on; already on in main conf + # gzip on; already on in main conf # Set level of compression gzip_comp_level 3; # Set mime types @@ -74,4 +74,8 @@ server { # limit_req zone=default burst=10 nodelay; error_page 404 /older_builds$request_uri; + + # logging + access_log /var/log/nginx/${NGINX_ARTIFACTS_VHOST}.access.log; + error_log /var/log/nginx/${NGINX_ARTIFACTS_VHOST}.error.log; }