I'm facing the same issue as described in How to force nginx to resolve DNS (of a dynamic hostname) everytime when doing proxy_pass? and thus wanted to apply the same solution.
My NginX, version 1.15.2, config now looks like this:
server { resolver 127.0.0.1; set $backend "http://dynamic.example.com:80"; proxy_pass $backend; }
Upon starting, I see the following error message
[emerg] 11#11: invalid number of arguments in "set" directive in /etc/nginx/conf.d/default.conf:3
Any clues?
set
directive? This kind of error usually means a missing ';' at the end of the line.