1
XIU2 2022-11-30 10:43:04 +08:00
我记得是 Nginx 启动时会对域名进行 DNS 解析,然后就一直使用得到的 IP 地址,直到重载或重启 Nginx 。
|
2
blackeeper 2022-11-30 11:02:05 +08:00
官方不是有么 [valid=time],可以自定义
Syntax: resolver address ... [valid=time] [ipv4=on|off] [ipv6=on|off] [status_zone=zone]; Default: — Context: http, server, location |
3
fighterhit OP @blackeeper 嗯,想知道没定义的情况下默认是多少
|
4
fighterhit OP @XIU2 嗯,发现后端 k8s service 没了,nginx dns 解析 service name 还是到老的 clusterIP
|
5
blackeeper 2022-12-02 09:58:21 +08:00
官方文档,默认就是 TTL 值,1.1.9 之前的版本 5 分钟
By default, nginx caches answers using the TTL value of a response. An optional valid parameter allows overriding it: resolver 127.0.0.1 [::1]:5353 valid=30s; Before version 1.1.9, tuning of caching time was not possible, and nginx always cached answers for the duration of 5 minutes. @fighterhit |
6
fighterhit OP @blackeeper 嗯这个看到过,1.1.9 太早了,现在默认多少呢
|