Ngnix Time out issue
We have nginx config for routing to another domain for certain endpoints which through AWS Route 53 calls to load balancer.
The routing works fine but after few days we face time out issue until we restart nginx container, though we have added resolver still we see time out happen after certain days, Adding below config for reference :-
**
server {
listen 443 ssl;
server_name appl1.xyz.com;
resolver 169.254.169.253 valid=30s;
# Initial configuration that experienced timeouts
location ~ ^/(url1|url2)$ {
proxy_pass https://appl2-prod.bytemark.co;
proxy_set_header Host appl2-prod.bytemark.co;
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;
}
location / {
proxy_pass https://appl1-prod:9120;
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;
}
}
Note : proxy_pass https://appl2-prod.bytemark.co; this directly added as static content instead of using variable, IS it the reason resolver is not working.
**
We are using Nginx nginx/1.27.5. Open source
Deployment environment: Prod
I will appreciate if anyone can help on this, Thanks in advance.