proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Content-Type application/json;
server {
listen 80;
server_name sandbox6.dev.ru;
location / {
return 403 ;
}
location ~ ^/api/v2/qa/diff/[0-9]+/(?<cache_key>.+) {
resolver 10.73.0.41;
proxy_http_version 1.1;
client_max_body_size 20m;
rewrite "^/api/v2/qa/diff/(.*)" /api/push/diff/$1 break;
proxy_pass http://test.qa.ru;
add_header X-Proxy-Cache $upstream_cache_status;
proxy_cache one;
proxy_cache_valid 200 2h;
proxy_cache_key $scheme$proxy_host$cache_key$is_args$args;
}
}
server {
listen 80;
server_name sandbox6.dev.ru;
location / {
return 403 ;
}
location ~ ^/api/v2/qa/diff/[0-9]+ {
resolver 10.8.8.81;
proxy_http_version 1.1;
client_max_body_size 20m;
set $cache_key "$1";
add_header X-Cache-Key "$cache_key";
add_header X-Proxy-Cache $upstream_cache_status;
proxy_cache $cache_key;
proxy_cache_valid 200 2h;
rewrite "^/api/v2/qa/diff/(.*)" /$1 break;
proxy_pass http://test.qa.ru/api/push/diff/$1?$args;
}
}
2021/11/13 14:14:35 [alert] 44920#44920: 40000 worker_connections are not enough
2021/11/13 14:14:35 [error] 44920#44920: *39997 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: *.*.18.189, server: app.test.ru, request: "GET /.well-known/acme-challenge/555.txt HTTP/1.0", upstream: "http://*.*18.189:80/.well-known/acme-challenge/555.txt", host: "lb"
upstream prematurely closed connection while reading response header from upstream