Re: Restrictions to modifying request->headers_in.headers in NGX_HTTP_PREACCESS_PHASE?

2018-03-29 Thread Robert Paprocki
Hello, On Thu, Mar 29, 2018 at 11:06 AM, Ryan Burn wrote: > > > This module injects multiple headers and the number, keys, etc aren't > meant to be exposed to the user. > > (This module is mean to support tracing and the injected headers btw > correspond to a SpanContext: >

Re: Restrictions to modifying request->headers_in.headers in NGX_HTTP_PREACCESS_PHASE?

2018-03-29 Thread Ryan Burn
On Thu, Mar 29, 2018 at 9:40 AM, Maxim Dounin wrote: > Hello! > > On Wed, Mar 28, 2018 at 04:15:44PM -0400, Ryan Burn wrote: > >> > You are not allowed to modify r->headers_in, at any time. >> >> If I want to ensure that certain headers are added if the request is >> proxied

Re: Access Nginx variables from HTTP modules

2018-03-29 Thread Paulo Silva
Would it be Ok doing something like? ngx_str_t variable_name = ngx_string("request_id"); ngx_uint_t variable_name_hash; ngx_http_variable_value_t *variable = NULL; variable_name_hash = ngx_hash_key(variable_name.data, variable_name.len); variable = ngx_http_get_variable(r, _name,

Re: Access Nginx variables from HTTP modules

2018-03-29 Thread Vladimir Homutov
On Thu, Mar 29, 2018 at 04:17:02PM +0100, Paulo Silva wrote: > Hi everyone, > can you point me the right way to access Nginx variables from my HTTP module? > > I am looking for a way to read the $request_id value from within one > of my modules' functions. >

Access Nginx variables from HTTP modules

2018-03-29 Thread Paulo Silva
Hi everyone, can you point me the right way to access Nginx variables from my HTTP module? I am looking for a way to read the $request_id value from within one of my modules' functions. Thanks, Paulo A. Silva https://a-caminho.de https://tech.pauloasilva.com

Re: ngx_write_fd

2018-03-29 Thread Ruslan Ermilov
On Thu, Mar 29, 2018 at 08:51:08AM +, Antonio Nappa wrote: > Hi, > > I was wondering what happens with ngx_write_fd function and multiple > workers, I have made some tests and it doesn't look like they are > interfering with each other and writing in the middle of a line. However I > am not

Re: Restrictions to modifying request->headers_in.headers in NGX_HTTP_PREACCESS_PHASE?

2018-03-29 Thread Maxim Dounin
Hello! On Wed, Mar 28, 2018 at 04:15:44PM -0400, Ryan Burn wrote: > > You are not allowed to modify r->headers_in, at any time. > > If I want to ensure that certain headers are added if the request is > proxied upstream, is there any way to do that? Recommended approach is to export a variable

[njs] Added additional log routines for different nginx log levels.

2018-03-29 Thread Dmitry Volyntsev
details: http://hg.nginx.org/njs/rev/36ef67f13052 branches: changeset: 472:36ef67f13052 user: Dmitry Volyntsev date: Thu Mar 29 16:38:02 2018 +0300 description: Added additional log routines for different nginx log levels. warn(), error(). diffstat:

Re: ngx_write_fd

2018-03-29 Thread Vasily Soshnikov
Hi, The UNIX-like system does not guarantee atomic write to a file (i.e. regular file). Actual, it works sometimes and for some system with tons of limitation. I prefer to avoid this practice. What can you do? You can lock (i.e. flock() and so on) file for writing, It's synchronization of

ngx_write_fd

2018-03-29 Thread Antonio Nappa
Hi, I was wondering what happens with ngx_write_fd function and multiple workers, I have made some tests and it doesn't look like they are interfering with each other and writing in the middle of a line. However I am not sure, that's the reason of my question. The file was opened with the