I am on Ubuntu 16.04 with the latest NGINX installed from their official repository:
$ sudo nginx -v
nginx version: nginx/1.11.8
I have the following defined in /etc/nginx/sites-available/greendot.conf
:
# local dnsmasq
resolver 127.0.0.1;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream websocket {
zone elixr 64k;
server greendot-elixr-1:4000 resolve;
server greendot-elixr-2:4000 resolve;
}
server {
listen 4000;
location / {
proxy_pass http://websocket;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
I have followed the documentation on setting up DNS resolved upstream servers, and yet this configuration fails:
$ sudo nginx -T
nginx: [emerg] invalid parameter "resolve" in /etc/nginx/sites-enabled/greendot-nginx.conf:11
nginx: configuration file /etc/nginx/nginx.conf test failed
My goal is to simply create a server which uses DNS to periodically resolve its members. What am I doing wrong?
The
resolve
parameter is part of nginx's commercial offering.Here's the approach I ended up using:
Note that: