This article is a mirror article of machine translation, please click here to jump to the original article.

View: 4952|Reply: 1

Nginx reverse proxy dynamic domain DNS caching issue

[Copy link]
Posted on 1/6/2022 2:28:48 PM | | | |
The domain name after reverse proxy is a dynamic domain name, the dynamic domain name is the peanut shell domain name used, the IP address is the home broadband, the router will change when the router is restarted, the dynamic domain name can be resolved normally, but nginx proxy_pass reverse proxy The IP resolved after the domain name is still old, when nginx starts loading the configuration file, it will resolve the domain name to IP, that is, the domain name is only resolved once.

When the dynamic domain IP address changes, when you visit the nginx site, the following appears:504 Gateway Time-out



Solution 1:

Restarting the nginx service, but not in the long run.

Solution 2:

Set the reverse proxy DNS refresh time.

The syntax for resolver is as follows:

Syntax: resolver address ... [valid=time] [ipv6=on|off];
Default:    —
Context:    http, server, location
resolver_timeout is used to specify the timeout for DNS resolution.

Modify the nginx.conf configuration file and add the following to the http node:

Restart the nginx service.





Previous:Java uses OkHttp to send HTTP network requests
Next:ESXI Windows Virtual Machine passes through to a USB hard drive
 Landlord| Posted on 1/6/2022 2:32:15 PM |
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com