From 4ac93aa1c546c7d83b9a3f0ebc3655924045b301 Mon Sep 17 00:00:00 2001 From: Nivesh Krishna Date: Thu, 9 Mar 2023 21:48:56 +0530 Subject: [PATCH 1/3] do not log for image_proxy route --- etc/nginx/conf.d/spot.conf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/etc/nginx/conf.d/spot.conf b/etc/nginx/conf.d/spot.conf index 3026429c3..1e8555ba3 100644 --- a/etc/nginx/conf.d/spot.conf +++ b/etc/nginx/conf.d/spot.conf @@ -14,10 +14,18 @@ server { location = /search { include /etc/nginx/proxy_spot_params; } + location = /image_proxy { + access_log off; + log_not_found off; + include /etc/nginx/proxy_spot_params; + } location / { try_files $uri @searx; + access_log off; + log_not_found off; } location @searx { + access_log /dev/stdout main; include /etc/nginx/proxy_spot_params; } } -- GitLab From b991fcdceb982d172a6dfc476c1881984826159b Mon Sep 17 00:00:00 2001 From: Nivesh Krishna Date: Thu, 9 Mar 2023 21:55:56 +0530 Subject: [PATCH 2/3] log x-ip --- etc/nginx/conf.d/spot.conf | 1 - etc/nginx/nginx.conf | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/etc/nginx/conf.d/spot.conf b/etc/nginx/conf.d/spot.conf index 1e8555ba3..507f21292 100644 --- a/etc/nginx/conf.d/spot.conf +++ b/etc/nginx/conf.d/spot.conf @@ -25,7 +25,6 @@ server { log_not_found off; } location @searx { - access_log /dev/stdout main; include /etc/nginx/proxy_spot_params; } } diff --git a/etc/nginx/nginx.conf b/etc/nginx/nginx.conf index 9621f159f..0d0a99201 100644 --- a/etc/nginx/nginx.conf +++ b/etc/nginx/nginx.conf @@ -14,7 +14,7 @@ http { include /etc/nginx/mime.types; default_type application/octet-stream; - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + log_format main '$http_x_forwarded_for - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$remote_addr"'; -- GitLab From 72282258eed4432e92bd099ce89277615d4b1d51 Mon Sep 17 00:00:00 2001 From: Nivesh Krishna Date: Thu, 9 Mar 2023 22:54:16 +0530 Subject: [PATCH 3/3] revert --- etc/nginx/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/nginx/nginx.conf b/etc/nginx/nginx.conf index 0d0a99201..9621f159f 100644 --- a/etc/nginx/nginx.conf +++ b/etc/nginx/nginx.conf @@ -14,7 +14,7 @@ http { include /etc/nginx/mime.types; default_type application/octet-stream; - log_format main '$http_x_forwarded_for - $remote_user [$time_local] "$request" ' + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$remote_addr"'; -- GitLab