Nginx keepalive and dns resolver

I have an nginx instance in AWS that has a top level application.

There are two requirements for nginx
- keepalive
- use a converter for dynamic upstream resolution

I can make any of them work.

Here is the configuration for keepalive to work:

upstream "backend" { server "appserver.example.com:443"; keepalive 250; } server { resolver 10.0.0.2 valid=60s; server_name _; location / { proxy_http_version 1.1; proxy_pass https://backend; } } 

Here is the configuration for the DNS resolver:

  server { resolver 10.0.0.2 valid=60s; server_name _; set $backend appserver.example.com:443; location / { proxy_http_version 1.1; proxy_pass https://$backend; } } 

How can I make DNS resolver and keepalive work without using a third-party plugin in open source NGinx

+6
source share
1 answer

According to this Nginx wiki page, it seems that the jdomain plugin

 http { resolver 8.8.8.8; resolver_timeout 10s; upstream backend { jdomain www.baidu.com; # keepalive 10; } server { listen 8080; location / { proxy_pass http://backend; } } } 
0
source

All Articles