Welcome! Log In Create A New Profile

Advanced

Re: Request Id for logging purposes

Francis Daly
February 04, 2015 02:18PM
On Wed, Feb 04, 2015 at 11:07:13AM -0800, Igal @ getRailo.org wrote:

Hi there,

> I want to be able to identify requests by a unique id.
>
> I'm able to do this in the location section:
>
> proxy_set_header X-Request-Id
> $pid-$msec-$remote_addr-$request_length;
>
> but I want instead to set it to a variable, e.g. in the http section:
>
> set $request_id $pid-$msec-$remote_addr-$request_length; ## does
> this work?

http://nginx.org/r/set

No.

It can be at "server" level, though.

> add_header X-Request-Id $request_id; ## I don't see it in
> the response headers

You probably were not running with this configuration.

> can it work?

With "set" at server{} level, yes.

All of the normal nginx configuration directive rules apply.

f
--
Francis Daly francis@daoine.org

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

Request Id for logging purposes

Igal @ getRailo.org February 04, 2015 02:08PM

Re: Request Id for logging purposes

Francis Daly February 04, 2015 02:18PM

Re: Request Id for logging purposes

Igal @ getRailo.org February 04, 2015 02:24PM

Re: Request Id for logging purposes

Igal @ getRailo.org February 04, 2015 02:36PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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