Welcome! Log In Create A New Profile

Advanced

Re: Nginx: conditional "expires" directive

António P. P. Almeida
August 16, 2011 07:38AM
On 16 Ago 2011 12h14 WEST, nginx-forum@nginx.us wrote:

> I wanted to create if block for expires directive, but it's not
> allowed in if context.
>
> Like that:
>
> if($args ~ "no_caching=1") {
> expires epoch;
> }
> Is it somehow possible to create this in any other way?
>
> I need nginx to change expire header to epoch when simple $_GET
> param no_cache=1 is in present.

You can try using the map directive:

http://wiki.nginx.org/HttpMapModule

map $args $caching_expires {
default 30d;
~no_caching=1 epoch;
}


location /whatever {
expires $caching_expires;
}

I haven't tried it myself.

--- appa

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

Nginx: conditional "expires" directive

somebi August 16, 2011 07:14AM

Re: Nginx: conditional "expires" directive

António P. P. Almeida August 16, 2011 07:38AM

Re: Nginx: conditional "expires" directive

somebi August 16, 2011 08:16AM

Re: Nginx: conditional "expires" directive

somebi August 16, 2011 08:25AM

Re: Nginx: conditional "expires" directive

António P. P. Almeida August 16, 2011 09:22AM

Re: Nginx: conditional "expires" directive

Oleksandr V. Typlyns'kyi August 16, 2011 11:12AM

Re: Nginx: conditional "expires" directive

somebi August 16, 2011 11:15AM

Re: Nginx: conditional "expires" directive

somebi August 16, 2011 11:16AM

Re: Nginx: conditional "expires" directive

somebi August 16, 2011 12:13PM

Re: Nginx: conditional "expires" directive

somebi August 16, 2011 01:03PM

Re: Nginx: conditional "expires" directive

somebi August 16, 2011 02:00PM

Re: Nginx: conditional "expires" directive

somebi August 16, 2011 02:18PM

Re: Nginx: conditional "expires" directive

António P. P. Almeida August 16, 2011 12:02PM

Re: Nginx: conditional "expires" directive

António P. P. Almeida August 16, 2011 12:06PM

Re: Nginx: conditional "expires" directive

António P. P. Almeida August 16, 2011 12:42PM

Re: Nginx: conditional "expires" directive

Oleksandr V. Typlyns'kyi August 16, 2011 12:58PM

Re: Nginx: conditional "expires" directive

Oleksandr V. Typlyns'kyi August 16, 2011 01:12PM

Re: Nginx: conditional "expires" directive

António P. P. Almeida August 16, 2011 02:12PM

Re: Nginx: conditional "expires" directive

Igor Sysoev August 16, 2011 02:24PM

Re: Nginx: conditional "expires" directive

António P. P. Almeida August 16, 2011 02:44PM

Re: Nginx: conditional "expires" directive

António P. P. Almeida August 16, 2011 02:34PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 127
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready