6

I'm trying to use a variable in nginx in server_name, but is not working. Is this possible?

server {
    listen 80;
    index index.php index.html;
    set $foo "bar.example.com";
    server_name $foo;
}
IAmJulianAcosta
  • 293
  • 1
  • 3
  • 11

1 Answers1

7

No it's not possible unless you want to set it to exactly the $hostname variable.

Ref:

user9517
  • 115,471
  • 20
  • 215
  • 297