Equivalent of Apache's SetEnv Variable

Michael Shadle mike503 at gmail.com
Thu Aug 5 14:45:09 MSD 2010

On Thu, Aug 5, 2010 at 3:40 AM, Grzegorz Nosek <grzegorz.nosek at gmail.com> wrote:

> Would you expect it to be processed after static requests only or also
> after *_pass?

I don't know :) All I know is I want to apply rules like expires
headers and such at the very end - those could be CSS/JS files being
generated on the fly by PHP for instance (which is horrible, but oh
well) and I'd like those to be treated just like static .css or .js
files. A "type" fixes that, a filename regexp does not. It's just an
example. That example -may- have just unraveled my whole point of the
discussion, too. It's late :)

> It's effectively impossible if Nginx doesn't run on the same node as the
> backend as it requires matching .../foo.php the URL with .../foo.php the
> file and acting upon the results. That's why I think it belongs as an
> extension in the static module.

understood. I'd say most of us are using things like try_files and if
(-e $request_filename) type checks already, so nginx is aware of the
files themselves, hence that interesting idea of a try_files $uri
inside of the location for .php files... unless I'm missing something
which is blatantly obvious in the internals of course :)

More information about the nginx mailing list