Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have nginx/0.7.68 running on my centos box with the following configuration

                listen       80;
                server_name ***;
                index index.html index.htm index.php default.html default.htm default.php;

                location / {
                        root   /***;
                        proxy_pass   http://***:8888;
                        index  index.html index.htm;

The server that my nginx proxy_pass to is a server with dynamic dns, whose ip change frequently. The problem is that nginx seems to cache the ip address of the destination of proxy_pass resulting request to the wrong ip address.

How can I solve this problem?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

It's an intriguing question and AFAIK that's not going to work well. You can try to use the upstream module and use the directives for failover to see if it works as a hack.

share|improve this answer
surprisingly when i changed to upstream, everything worked as expected. I'll then mark this as correct answer –  xiamx Feb 27 '11 at 22:20
add comment

looking through the nginx source, it does appear nginx is hardcoded to cache resolves for their TTL - what's the TTL on your dynamic dns?

share|improve this answer
TTL on my ddns is 60s, the default value of dyndns.com –  xiamx Feb 26 '11 at 3:19
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.