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
source share