6

I'm using the set directive as described in the nginx doc but I keep getting this error:

nginx_1     | 2016/09/13 15:06:08 [emerg] 8#8: invalid number of arguments in "set" directive in /etc/nginx/conf.d/default.conf:9
nginx_1     | nginx: [emerg] invalid number of arguments in "set" directive in /etc/nginx/conf.d/default.conf:9

default.conf :

server {
    set $dn "foo.dnsalias.net";
    ...
}

I've tried both with and without quotes, with no change.

I'm using nginx version 1.10.1

Does anyone know what the issue is?

Gareth Jones
  • 1,241
  • 4
  • 17
  • 38
Slakk
  • 107
  • 1
  • 1
  • 6

1 Answers1

7

In your snippet you have

server {
    set $dn "foo.dnsalias.net";
    ...
}

However, if in your actual conf file you are missing a trailing semicolon ; after the set directive, the directive will not be terminated and text on the next line will be treated as additional arguments, which will trigger your error.

Drakes
  • 23,254
  • 3
  • 51
  • 94