Equivalent of Apache's SetEnv Variable

Grzegorz Nosek grzegorz.nosek at gmail.com
Thu Aug 5 14:53:26 MSD 2010


On czw, sie 05, 2010 at 03:45:09 -0700, Michael Shadle wrote:
> 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 :)

Oh, so my patch wouldn't help you at all for dynamically generated css
files. You'd have to teach your app to send the proper headers itself.

> 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 :)

Yes, Nginx is aware of files, of course :) but unlike Apache, where
everything must be a file, it prefers operating on URLs and uses files
as late as possible. That's my understanding of its philosophy, at
least.

Best regards,
 Grzegorz Nosek



More information about the nginx mailing list