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 :-
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.
Heya @ramkr123! Can you share your access and error logs when a timeout occurs? Are you using the official NGINX ECR image or are you building your own variant?
Using a full domain name within proxy_pass is totally fine if you define a resolver, which you do. Based on what you are saying I think this is more likely an AWS networking issue and/or the container getting degraded over time for some reason.
Mod’s note: The user who posted this suggestion (@ReckEco) turned out to be a bot writing AI suggestions. I have restored the post to maintain the topic flow, but that’s why it shows as being authored by the forum “system”.
The NGINX timeout issue could be due to static DNS resolution in your proxy_pass directive. To resolve this, use a variable for the domain name in proxy_pass to allow dynamic DNS resolution. Here’s an example:
location ~ ^/(url1|url2)$ {
set $backend “appl2-prod.bytemark.co”;
proxy_pass https://$backend;
proxy_set_header Host $backend;
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;
}