Welcome! Log In Create A New Profile

Advanced

shell environment variables in "include"-directive not working

Markus Grobelin
May 12, 2010 06:54PM
Hy everybody,
i'm doing my first steps with nginx/0.8.36 and trying to get *NIX shell
environment variables working inside the configuration files. Sadly,
it's seems they aren't working inside the "include"-directive! :(



My current (very basic) configuration looks like this:

# user and group to run as
user $USER $USER;

# pid of nginx master process
pid /nginx/$INSTANCE/run/nginx.pid;

# number of nginx workers
worker_processes 2;

# number of worker connection
events {
worker_connections 1024;
}

http {
# pull in mime-types
include /nginx/INSTANCE/nginx/conf/mime.types;

# set a default type for the rare situation that
# nothing matches from the mimie-type include
#
default_type application/octet-stream;

# logging in server-context
#
access_log /nginx/$INSTANCE/nginx/logs/access.log
error_log /nginx/$INSTANCE/nginx/logs/error.log
}


When starting the server i got the following messages:
[alert]: could not open error log file: open()
"/var/log/nginx/error.log" failed (13: Permission denied)
2010/05/13 00:16:38 [warn] 27977#0: the "user" directive makes sense
only if the master process runs with super-user privileges, ignored in
/nginx/wally1-dach-static/nginx/conf/nginx.conf:2
2010/05/13 00:16:38 [emerg] 27977#0: open()
"/nginx/$INSTANCE/nginx/conf/mime.types" failed (2: No such file or
directory) in /nginx/wally1-dach-static/nginx/conf/nginx.conf:18



The [emerg] indicates, that the $INSTANCE environment variable isn't
expanded, whereas the "user" and "pid" directive doesn't raise an
exception??

Cheers,
Markus


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

shell environment variables in "include"-directive not working

Markus Grobelin May 12, 2010 06:54PM

Re: shell environment variables in "include"-directive not working

Maxim Dounin May 12, 2010 08:36PM

Re: shell environment variables in "include"-directive not working

Markus Grobelin May 14, 2010 07:16AM

Re: shell environment variables in "include"-directive not working

Maxim Dounin May 14, 2010 09:00AM

Re: shell environment variables in "include"-directive not working

Markus Grobelin May 15, 2010 09:16AM

Re: shell environment variables in "include"-directive not working

Brian H. February 23, 2013 06:04PM

Re: shell environment variables in "include"-directive not working

Igor Sysoev May 13, 2010 02:46AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 143
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready