Welcome! Log In Create A New Profile

Advanced

Re: Include don't Loading have Variables Path

Maxim Dounin
December 30, 2009 05:14AM
Hello!

On Wed, Dec 30, 2009 at 08:54:58AM +0100, Nginx fans wrote:

[...]

> include $web_root/.htaccess; This is load Rewrite Rule for nginx
> But Nginx don't load why?
>
> [emerg]: CreateFile() "D:\nginx/conf/$web_root\.htaccess" failed (3: The
> system cannot find the path specified) in D:\nginx/conf/nginx.conf:42

Variables in nginx are evaluated at run time for each request. On
the other hand, configuration is loaded and parsed during startup.
So you can't use variables for things needed during configuration
parsing, e.g. "include".

Moreover, you don't need variables to set root. It doesn't change
between requests. Using variables here is just waste of
resources, warming the world for no reason. You don't need
variables, you need configuration macros which are expanded at
time of reading configuration.

nginx doesn't support configuration macros, but they are
trivially added by any config generation tools (e.g. make + sed
will do the trick).

Maxim Dounin

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

Include don't Loading have Variables Path

Nginx fans December 30, 2009 03:00AM

Re: Include don't Loading have Variables Path

Maxim Dounin December 30, 2009 05:14AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 135
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready