title: How to define a global variable in nginx conf file
body: <p>How to define a global variable in nginx conf file, define a global var in http block,and all servers and locations below can use it.</p>
  
  <pre><code>http{
        some confs
        ...
        //define a global var mabe like
        set APP_ROOT /home/admin
        // and it can be use in all servers and locations below, like
        server {
          root $APP_ROOT/test1
        }
  
        server {
          root $APP_ROOT/test2
        }
    }
  </code></pre>