小编jay*_*oby的帖子

我应该使用什么 DNS 服务器来接收我的 nginx 解析器的 AWS 内部地址?

我正在使用 AWS Elasticache 服务器example.foo.euw1.cache.amazonaws.com我希望 nginx 能够在位置指令中使用它(这只是一个简单的例子):

location /cached {
  set $memcached_key $uri;
  memcached_pass  example.foo.euw1.cache.amazonaws.com:11211;
  try_files $uri =404;
}
Run Code Online (Sandbox Code Playgroud)

因为 Elasticache 节点 IP 地址可以更改,所以我不想使用 example.foo.euw1.cache.amazonaws.com 的当前 IP 地址。

resolver应该使用什么IP 来获取 AWS 内部 IP 地址 (10.x) 而不是面向公众的版本 (79.x)?

在运行 nginx 的机器上,我可以通过以下host调用来模拟:

$ host example.foo.euw1.cache.amazonaws.com
$ 10.120.40.80
$ # ^^^ that's the correct internal address I want to use
$
$ host example.foo.euw1.cache.amazonaws.com 8.8.4.4
$ 79.125.100.150
$ # ^^^ that's the public IP that I don't want …
Run Code Online (Sandbox Code Playgroud)

domain-name-system nginx resolve amazon-web-services

5
推荐指数
1
解决办法
1万
查看次数