Welcome! Log In Create A New Profile

Advanced

Re: Absolute rather than relative times in expires directives

Francis Daly
November 18, 2015 08:46AM
On Tue, Nov 17, 2015 at 03:07:33AM -0500, rgrraj wrote:

Hi there,

> The topic was the same one I was looking for. But we have specific idea of
> setting up the expire value. We need expires to be at every 2h hours at the
> same time to be on every 24hours, ie: midnight. Can you help me with how to
> configure the same with 2h as well as for midnight night.

http://nginx.org/r/expires shows how you can set the value, and shows
that it accepts a variable.

http://nginx.org/r/map shows how you can set one variable from the value
of another.

http://nginx.org/en/docs/http/ngx_http_core_module.html#variables shows
the list of "always there" variables; two of them refer to "local time".

So putting them all together:

map $time_iso8601 $expires {
default "2h";
~T22 "@00h00";
~T23 "@00h00";
}

expires $expires;

(in the right parts of the config file) might do some of what you want.

Probably you will have to adjust some of those numbers to match "local
midnight" or "UTC midnight"; and possibly you will want to adjust the
regex to allow for the local timezone offset -- see the $time_iso8601
value.

But that should be a start.

f
--
Francis Daly francis@daoine.org

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

Absolute rather than relative times in expires directives

Mark James August 01, 2010 05:30AM

Re: Absolute rather than relative times in expires directives

Denis F. Latypoff August 01, 2010 05:58AM

Re: Absolute rather than relative times in expires directives

Mark James August 01, 2010 07:48AM

Re: Absolute rather than relative times in expires directives

Ryan Malayter August 01, 2010 11:06AM

Re: Absolute rather than relative times in expires directives

Igor Sysoev August 01, 2010 12:02PM

Re: Absolute rather than relative times in expires directives

Ryan Malayter August 02, 2010 09:22AM

Re: Absolute rather than relative times in expires directives

rgrraj November 17, 2015 03:07AM

Re: Absolute rather than relative times in expires directives

Francis Daly November 18, 2015 08:46AM

Re: Absolute rather than relative times in expires directives

rgrraj January 21, 2016 02:19AM

Re: Absolute rather than relative times in expires directives

Francis Daly January 23, 2016 06:16AM

Re: Absolute rather than relative times in expires directives

rgrraj January 24, 2016 02:21AM

Re: Absolute rather than relative times in expires directives

B.R. January 24, 2016 08:46AM

Re: Absolute rather than relative times in expires directives

Maxim Dounin January 25, 2016 10:16AM

Re: Absolute rather than relative times in expires directives

rgrraj February 01, 2016 12:24AM

Re: Absolute rather than relative times in expires directives

Francis Daly February 01, 2016 04:16AM

Re: Absolute rather than relative times in expires directives

Maxim Dounin February 01, 2016 07:46AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 312
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