title: How to use an environment variable as prefix path while configuring NGINX?
body: <p>I am trying to use <code>$NGINX_PREFIX</code> as a prefix to logging. At runtime the link editor should expand <code>$NGINX_PREFIX</code>. I am using the following command to build nginx:</p>
  
  <pre><code>./configure --prefix=\$NGINX_PREFIX --sbin-path=objs/nginx --conf-path=conf/nginx.conf --error-log-path=logs/error.log --http-log-path=logs/access.log
  </code></pre>
  
  <p>I am using environment variables is because I want to re-use the built binary on different machines.</p>
  
  <p>But when I use the build binary file <code>objs/nginx</code>, it says the following:</p>
  
  <pre><code>nginx: [alert] could not open error log file: open() "$NGINX_PREFIX/logs/error.log" failed (2: No such file or directory)
  2018/08/22 17:54:08 [emerg] 16060#0: open() "$NGINX_PREFIX/conf/nginx.conf" failed (2: No such file or directory)
  </code></pre>
  
  <p>Now mind you I have correctly set the environment variables and the files for which errors are being shown above are already present.</p>
  
  <p>Where am I going wrong? Is it because of the ENV variables? If yes, how can I get a pre-built nginx binary which I can re-use on multiple machines without building it again and again? </p>