Grzegorz Nosek
August 18, 2010 10:52AM
On Wed, Aug 18, 2010 at 04:19:08PM +0200, Grzegorz Nosek wrote:
> Hi all,
>
> After a recent discussion I decided to whip up a patch implementing the
> type {} directive to route requests according to MIME types of requested
> files.
>
> The main advantage is a clearer config file, as instead of:
>
> | location ~ \.(gif|png|jpe?g|tif|ico) {
> | expires max;
> | access_log off;
> | }
>
> you can now say:
>
> | type image/* {
> | expires max;
> | access_log off;
> | }

I forgot to say that the type{} directive works inside location{} blocks
too:

| location /dev/ {
| root /www/dev;
|
| type text/* {
| expires epoch;
| }
| }
|
| location /prod/ {
| root /www/prod;
|
| type text/* {
| expires max;
| }
| }

Although if you put a text{} block inside a location{}, this location no
longer interprets e.g. server{}-level types. We'll see if this is a
problem by popular demand :)

Best regards,
Grzegorz Nosek

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

[Patch] type{} directive

Grzegorz Nosek 2237 August 18, 2010 10:20AM

Re: [Patch] type{} directive

Michael Lustfield 838 August 18, 2010 10:28AM

Re: [Patch] type{} directive

Grzegorz Nosek 1128 August 18, 2010 10:52AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 236
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready