@@ -29,10 +29,36 @@ server {
2929 access_log {{.access_log_path}};
3030 error_log {{.error_log_path}};
3131
32+ # Timeout configurations from tracker server config
33+ proxy_connect_timeout {{.readiness_timeout}};
34+ proxy_send_timeout {{.announce_timeout}};
35+ proxy_read_timeout {{.announce_timeout}};
36+
3237 location / {
3338 proxy_pass http://tracker;
39+
40+ # Pass original client info
41+ proxy_set_header Host $host;
42+ proxy_set_header X-Real-IP $remote_addr;
43+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
44+ proxy_set_header X-Forwarded-Proto $scheme;
45+ }
46+
47+ # Health and readiness checks with shorter timeout
48+ location ~ ^/(health|readiness)$ {
49+ proxy_pass http://tracker;
50+
51+ proxy_read_timeout {{.readiness_timeout}};
52+ proxy_send_timeout {{.readiness_timeout}};
53+
54+ # Pass original client info
55+ proxy_set_header Host $host;
56+ proxy_set_header X-Real-IP $remote_addr;
57+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
58+ proxy_set_header X-Forwarded-Proto $scheme;
3459 }
3560
61+ # Metainfo requests need longer timeout (cached)
3662 location ~* ^/namespace/.*/blobs/.*/metainfo$ {
3763 proxy_pass http://tracker;
3864
@@ -41,6 +67,31 @@ server {
4167 proxy_cache_valid 200 5m;
4268 proxy_cache_valid any 1s;
4369 proxy_cache_lock on;
70+
71+ # Use metainfo timeout for these operations
72+ proxy_read_timeout {{.metainfo_timeout}};
73+ proxy_send_timeout {{.metainfo_timeout}};
74+
75+ # Pass original client info
76+ proxy_set_header Host $host;
77+ proxy_set_header X-Real-IP $remote_addr;
78+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
79+ proxy_set_header X-Forwarded-Proto $scheme;
80+ }
81+
82+ # Announce operations
83+ location ~ ^/announce {
84+ proxy_pass http://tracker;
85+
86+ # Use announce timeout for these operations
87+ proxy_read_timeout {{.announce_timeout}};
88+ proxy_send_timeout {{.announce_timeout}};
89+
90+ # Pass original client info
91+ proxy_set_header Host $host;
92+ proxy_set_header X-Real-IP $remote_addr;
93+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
94+ proxy_set_header X-Forwarded-Proto $scheme;
4495 }
4596}
4697`
0 commit comments