I know the this question is asked multiple times and not related to aws.
2020/07/29 10:23:17 [error] 6#6: *37749 connect() failed (113: Host is unreachable) while connecting to upstream, client:
I am facing this issue while I have deployed nginx in aws cloud.
localtion configuration
location /test {
proxy_pass http://test-service;
proxy_set_header HOST $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Upstream section like below
upstream test-service {
server test-service.internal:38102;
keepalive 10;
}
Here test-service.internal is my route53 hosted zone entry and it is pointing to some internal application load balancer of aws.
When I deploy/restart nginx server, it works well but after few days (around two/three days) it will hang in proxy pass only. When I load html content, it works perfectly but proxy pass call stuck.
Any solution would be helpful?
Thanks.