[PATCH] new prefix HTTP variable

Manlio Perillo manlio.perillo at gmail.com
Thu Apr 19 09:26:03 UTC 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Il 19/04/2012 11:00, Maxim Dounin ha scritto:
> Hello!
> 
> On Wed, Apr 18, 2012 at 10:58:37PM +0200, Manlio Perillo wrote:
> 
>> Attached is a patch that adds a new "prefix" http variable, that returns
>> the Nginx prefix path.
> 
> Could you please elaborate a bitmore on expected use cases?
> 

I have some Python applications running under my ngx_http_wsgi_module.

For these application, I set the Nginx prefix command line option to the
application working directory.

- From Nginx configuration I use the wsgi_var directive to set the path to
application configuration file, and currently I have to do something like:

   set $app_path /path/to/application
   ...

   wsgi_var app_conf_path $app_path/settings.yml


With the prefix variable, I can avoid having to define an additional
variable:

   wsgi_var app_conf_path $prefix/settings.yml


I don't know if there are some other possible use cases.

Usually in Nginx there is no need for the "prefix" variable, since most
of the paths in directives are resolved against the prefix path.



Manlio Perillo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk+P2isACgkQscQJ24LbaURdTQCfVfXXi+MPJjx4F5jJ7nyCQVjK
9oUAn0TO8jpg4Y6Ims/so9YNzBRO4NCR
=wAI1
-----END PGP SIGNATURE-----



More information about the nginx-devel mailing list