ngx_http_complex_value VS ngx_http_script

Maxim Dounin mdounin at
Wed Feb 22 14:29:33 UTC 2012


On Wed, Feb 22, 2012 at 02:30:46PM +0400, Sergey Petrov wrote:

> Hi,
> can somone explain the difference? What's the correct usecase for
> ngx_http_script?

The complex value is basically a simplified envelope for script 
functionality for a simple case of a single string with (optional) 

In most cases (unless you are targeting your code for old nginx 
versions) a complex value will be ok for you.  Note complex values 
were introduced relatively recently, so in many cases nginx code 
still uses script directly.

There are also some specific situations though, when you may need 
to use script functionality directly.  E.g. proxy module will do 
this when evaluating proxy_set_header directives, as this allows 
flush uncacheable variables only once.

Maxim Dounin

More information about the nginx-devel mailing list