Skip to content

Commit 95ac679

Browse files
vgrichinaclaude
andcommitted
feat: Add debug logging format for nginx upstream
Log upstream status, response time, and cache status to help debug intermittent 400 errors from IPFS fetch operations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 2525649 commit 95ac679

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

nginx/templates/default.conf.template

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
proxy_cache_path /var/nginx-cache levels=1:2 keys_zone=small:1m inactive=1m;
22

3+
log_format debug_upstream '$remote_addr - [$time_local] "$request" '
4+
'$status $body_bytes_sent '
5+
'up: $upstream_status/$upstream_response_time '
6+
'cache: $upstream_cache_status';
7+
38
upstream web4 {
49
server ${NGINX_UPSTREAM_HOST}:${NGINX_UPSTREAM_PORT};
510

@@ -28,6 +33,7 @@ map $http_referer $bad_referer {
2833

2934
server {
3035
listen 80 default_server;
36+
access_log /var/log/nginx/access.log debug_upstream;
3137

3238
if ($bad_referer) {
3339
return 444;

0 commit comments

Comments
 (0)