Welcome! Log In Create A New Profile

Advanced

Re: can a map + regex be used to generate variables for YYYY-MM-DD-HH?

Francis Daly
October 24, 2014 02:14PM
On Fri, Oct 24, 2014 at 01:44:19PM -0400, newnovice wrote:

Hi there,

> 1. variable in logname is what i want: access_log.YYYY-MM-DD-HH

http://nginx.org/r/access_log

That can work.

> 2. (currently i use this method) 'if' - inside server - outside location -
> works.

http://nginx.org/r/if

That's good. Note that "if" inside "location" should not be used unless
you "return" or "rewrite...last", unless you know what you are doing.

But where you have it, inside server{}, is fine.

> Only when i get non ssl traffic to 443 port it writes out
> access_log.---- instead of the usual: 'access_log.2014-10-24-17'
> 2.1 is this a bug ?

It looks to me like it might be.

* I would naively have expected error_log output there, not access_log.
* The number of "-" in the file name looks wrong.

> 3. also tried map inside server block - outside location & its not allowed
> there.

http://nginx.org/r/map -- correct, "map" only goes at http level.

You can refer to the variable that it creates, at server level.

f
--
Francis Daly francis@daoine.org

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

can a map + regex be used to generate variables for YYYY-MM-DD-HH?

newnovice October 23, 2014 02:00AM

Re: can a map + regex be used to generate variables for YYYY-MM-DD-HH?

Francis Daly October 23, 2014 05:06PM

Re: can a map + regex be used to generate variables for YYYY-MM-DD-HH?

newnovice October 23, 2014 07:17PM

Re: can a map + regex be used to generate variables for YYYY-MM-DD-HH?

Francis Daly October 24, 2014 03:22AM

Re: can a map + regex be used to generate variables for YYYY-MM-DD-HH?

newnovice October 24, 2014 01:44PM

Re: can a map + regex be used to generate variables for YYYY-MM-DD-HH?

Francis Daly October 24, 2014 02:14PM

Re: can a map + regex be used to generate variables for YYYY-MM-DD-HH?

newnovice October 24, 2014 05:14PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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