ized in [init process].
>
>
>
>
> Ben
> best regards
>
>
>
> Original Message
> *Sender:* Dk Jack<dnj0...@gmail.com>
> *Recipient:* nginx-devel@nginx.org<nginx-devel@nginx.org>
> *Date:* Wednesday, Apr 19, 2017 10:03
> *Su
Hi,
I am new to NGinx modules and I trying to write an nginx module. I am
having an issue
where my module crashes when adding multiple timers. The first timer adds
fine.
However, when I go to add the second timer, it crashes. I've simplified the
code to a very
basic module (which is attached to
LL,/* init thread */
NULL, /* exit thread */
NULL,/* exit process */
NULL,/* exit master */
NGX_MODULE_V1_PADDING
};
On Tue, Apr 18, 2017 at 5:12 PM, Dk Jack <dnj0...@gmail.com> wrot
ry to insert the second timer.
On Tue, Apr 18, 2017 at 6:53 PM, 胡聪 (hucc) <hucon...@foxmail.com> wrote:
> Hi,
>
> At the first glance, the ev->log should be assigned a valid value.
>
>
> -- Original --
> *From: * "Dk Jack";<dnj0.
Hi,
In my module, I registered a NGX_HTTP_POST_READ_PHASE handler. When this
handler is invoked, I allocate my module context and attach it to the
request. I also allocate some other memory and save the pointers to that
memory in my context. In the POST_READ_PHASE handler, I also register a
d, May 17, 2017 at 05:53:40PM -0700, Dk Jack wrote:
>>
>> Hi,
>> In my module, I registered a NGX_HTTP_POST_READ_PHASE handler. When this
>> handler is invoked, I allocate my module context and attach it to the
>> request. I also allocate some other memory
Thu, May 18, 2017 at 10:23:18AM -0700, Dk Jack wrote:
>
> > I just want to release memory l've allocated. One more question,
> > is the context memory automatically removed or is the module
> > responsible for freeing it.
>
> Anything you allocate from request pool (r-&
Hi,
I am trying to send a custom response in my module when I encounter a
request for a specific location. For example, I have setup my location as
follows:
server {
listen ;
location /__my_module {
set_mymodule_location;
log_not_found off;
}
}
In my location
_DECLINED;
Bhasker.
Hello!
On Wed, May 16, 2018 at 10:02:02AM -0700, Dk Jack wrote:
>* Hi,
*>* I am trying to send a custom response in my module when I encounter a
*>* request for a specific location. For example, I have setup my location as
*>* follows:
*> >* s
Thanks for the quick response. This is exactly what I need. Yes, it is a
NGX_HTTP_MODULE.
How do I ensure, "this module is behind ngx_event_core_module"? Thanks.
Dk
On Thu, Oct 26, 2017 at 9:12 PM, 胡聪 (hucc) <hucon...@foxmail.com> wrote:
> Hi,
>
> On Friday, Oct 27, 20
Hi,
In my module I'd like to monitor the creation of a file (at a specific)
using inotify or something similar and load some data from the file. How
would I go about hooking up the inotifyFd with the nginx event system so
that I get a callback when the file is created on the disk?
Dk.
Hi,
In my module, I'd like to look into the post body to decide if the request
should be allowed to proceed to origin server or not. Based on the examples
I could find I've coded this in my module. After some trial and error it
seems to be working. I am not sure if my implementation is 100%
Haven't received any response to inquiry. Would appreciate it if someone
can comment.
Thanks,
Dk.
On Thu, Aug 2, 2018 at 12:29 PM Dk Jack wrote:
> Hi,
> In my module, I'd like to look into the post body to decide if the request
> should be allowed to proceed to origin server or n
Thank you. Will looking it and get back. Since I need to inspect, I'll
follow your suggestion
and see if I can use the body filter option.
regards,
Dk
On Wed, Aug 8, 2018 at 11:34 AM Maxim Dounin wrote:
> Hello!
>
> On Tue, Aug 07, 2018 at 10:46:08PM -0700, Dk Jack wrote:
>
with the different 'rc' values for the
finalize_req i.e. 'rc = NGX_DONE/OK/ERROR' as well. I still see the same
result. Please let me know if you have any other suggestions you'd like me
to try. Thanks.
./D
On Sat, Jul 14, 2018 at 2:37 PM Roman Arutyunyan wrote:
> Hi Dk Jack,
>
> On Fr
ount:1
2018/07/15 23:28:58 [debug] 12381#12381: *2 http request count:1 blk:0
2018/07/15 23:28:58 [debug] 12381#12381: *2 http close request
2018/07/15 23:28:58 [debug] 12381#12381: *2 http log handler
On Sat, Jul 14, 2018 at 10:26 PM Roman Arutyunyan wrote:
> Hi,
>
> On Sat, Jul 14, 2
Thanks Roman,
Passing NGX_OK to finalize_request also worked. I'll use that. Thanks for
all you help.
Dk
PS: Requiring ev->data to be of type ngx_conn_t is a strange one. I thought
it was for user data.
On Mon, Jul 16, 2018 at 4:29 AM Roman Arutyunyan wrote:
> Hi Dk Jack,
>
> On
'header already sent' messages in the error log."
On Thu, Jul 12, 2018 at 1:29 PM Dk Jack wrote:
> Hi,
> Sorry for sending this again. I haven't been able to resolve my issue.
> I've read several modules for example and gone over several docs etc. but
> with no success so far.
&g
Hi,
>From within my module, I'd like rewrite the URL. Especially, the host
portion of the URL. In the nginx devel guide it talks about nginx internal
redirect but that's only affecting the uri portion of the url. I'd like to
do what proxy_pass does but from within my module.
It'd help me
Hi,
In my module, I am trying to forward the request to my server based on the
content of the request body. To acheive this, I've added a body capture
filter to capture the body. My code is something like this...
static ngx_int_t
nginx_inspect_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
{
After experimenting a little more, it looks it happens when I return error
codes that don't fall between NGX_OK - NGX_ABORT. After changing my code to
return NGX_DECLINED, the error log went away.
On Thu, Jul 5, 2018 at 5:44 PM Dk Jack wrote:
> Hi,
> I have an nginx module. The purpose
Hi,
I have an nginx module. The purpose of my module is to inspect every
request and make a binary decision (i.e drop or allow). When dropping, I am
sending a custom status code and response message. I've setup my module
handler to be called in the NGX_HTTP_REWRITE_PHASE. Things seem to be
working
. the
response.
Dk.
On Thu, Jul 5, 2018 at 5:44 PM Dk Jack wrote:
> Hi,
> I have an nginx module. The purpose of my module is to inspect every
> request and make a binary decision (i.e drop or allow). When dropping, I am
> sending a custom status code and response message. I've setup my modu
@Hung Nguyen,
Sorry did not see your response. Looks like my email settings were
incorrect and I was not receiving the emails.
I am looking for a way to send custom response without having to change the
config.
Dk.
On Fri, Jul 6, 2018 at 2:33 PM Dk Jack wrote:
> Hi,
> I thought I sol
onf(cf, ngx_http_core_module);
hptr = ngx_array_push(>phases[NGX_HTTP_ACCESS_PHASE].handlers);
if (hptr == NULL) {
ngx_log_error(NGX_LOG_ERR, cf->log, 0, "Cannot retrieve Nginx access
phase handler pointer");
return NGX_ERROR;
}
*hptr = ngx_http_request_handler;
ngx_log_error(NGX_
Hi,
Sorry for sending this again. I haven't been able to resolve my issue. I've
read several modules for example and gone over several docs etc. but with
no success so far.
In my module, I need to either drop the request or allow the request. When
I drop the request, I need to send custom
2018 at 10:58:29PM -0700, Dk Jack wrote:
>
> > Hi,
> > In my module, I am trying to forward the request to my server based on
> the
> > content of the request body. To acheive this, I've added a body capture
> > filter to capture the body. My code i
it has something to do with internal
redirect and body capture. Thanks
> On Sep 11, 2018, at 5:55 AM, Maxim Dounin wrote:
>
> Hello!
>
>> On Mon, Sep 10, 2018 at 10:58:29PM -0700, Dk Jack wrote:
>>
>> Hi,
>> In my module, I am trying to fo
Hi,
In my module, I am trying to forward the request to my server based on the
content of the request body. To acheive this, I've added a body capture
filter to capture the body. Here are the relevant parts of my code...
static ngx_int_t
nginx_inspect_body_filter(ngx_http_request_t *r,
Hi,
In my module, I am capturing the request body to check if the body contains
some specific content. If the body does not contain the specific content
then I pass on the request without modification. Otherwise, I send a
HTTP_FORBIDDEN. I am using 'ngx_http_read_client_request_body' call to
I was able to resolve this by invoking finalize_request.
On Wed, Jul 24, 2019 at 4:14 PM Dk Jack wrote:
> Could someone comment on my question below. What does it mean when the
> connections are stuck in 'Writing' state? Since the client has received the
> response, why is the nginx st
.
On Tue, Jul 23, 2019 at 6:17 PM Dk Jack wrote:
> Hi,
> In my module, I am capturing the request body to check if the body
> contains some specific content. If the body does not contain the specific
> content, I pass on the request without modification. Otherwise, I send a
> HTTP_FORBID
Hi,
In my module I have the following requirements:
- Inspect the contents of the POST body in the request
- If the body content matches the configured regex, then take one of the
following actions:
- Return forbidden
- Redirect to another location without using 302
- If the content doesn't
Hi,
I am trying to understand how the modules work when dealing with http2
traffic? Trying to find any documentation or any other info that will
tells me how a module should behave when handling http2 traffic. I am
assuming the actual http2 protocol parsing is done by the http2 module. How
can a
Hi,
I have a module. I am saving some data in my module context. However, in
certain cases, I am doing an internal redirect. When I do an internal
redirect my context is cleared as per the nginx development guide. Is there
a way to save the context data. Since this data is specific to the request,
Hi,
In my module, I am trying to take actions based on the content of the body.
To accomplish this, I am capturing the body using body file as shown in the
example below:
http://mdounin.ru/hg/ngx_http_catch_body_filter_module/file/tip/ngx_http_catch_body_filter_module.c
This is working well. I
est body
> earlier - for example, you can do this from your own module, or
> with embedded scripting such as perl or njs.
>
> --
> Maxim Dounin
> http://mdounin.ru/
> _______
> nginx-devel mailing list
> nginx-devel@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>
Hi,
In my module, I am inspecting the request body. My body filter init code is
shown below:
int
module_body_filter_init(ngx_conf_t *cf)
{
ngx_http_next_body_filter = ngx_http_top_request_body_filter;
ngx_http_top_request_body_filter = nginx_module_inspect_body_filter;
return NGX_OK;
}
llo!
>
> On Mon, Aug 09, 2021 at 11:48:35AM -0700, Dk Jack wrote:
>
> > Hi,
> > In my module, I am inspecting the request body. My body filter init code
> is
> > shown below:
> >
> > int
> > module_body_filter_init(ngx_conf_t *cf)
> > {
> >
Hi,
I am seeing an alert in the nginx error.log with the message "http request
count is zero". It seems to be from this code in
src/http/ngx_http_request.c:
if (r->count == 0) {
ngx_log_error(NGX_LOG_ALERT, c->log, 0, "http request count is zero");
}
These alerts are showing up for requests
I haven't played with them myself, but have considered sub-requests? Since
your are using a library with its own event-loop, perhaps it's best to run
it in its own process and use nginx sub-requests to bridge the two
processes? Seems doable.
Thanks Maxim,
Thanks for the suggestion about using ngx_pool_cleanup_add. Since this is
external library memory I couldn't use ngx_pcalloc. Thanks again.
On Wed, Nov 10, 2021 at 7:47 PM Maxim Dounin wrote:
> Hello!
>
> On Wed, Nov 10, 2021 at 07:22:50PM -0800, Dk Jack wrote:
>
>
Hi,
In my module, I am allocating some memory for each request and saving the
ptr in my module context. I am registering a callback using
ngx_http_cleanup_add to perform cleanup for each request. I am releasing
the memory for the allocation in the cleanup callback. In the log phase, I
want to make
Hello Maxim,
could you please respond to my previous message. Thanks.
Dk.
On Tue, Jul 13, 2021 at 9:28 PM Dk Jack wrote:
> Hello Maxim,
> Thanks for responding. Can I get some clarification on what you mean by
> the statement below:
>
> "More flexibility can be achieved by
Thanks Maxim,
Are there any other situations where last_buf would not be set besides the
case of content-length being zero?
On Wed, Jan 26, 2022 at 5:23 PM Maxim Dounin wrote:
> Hello!
>
> On Wed, Jan 26, 2022 at 04:55:52PM -0800, Dk Jack wrote:
>
> > Hi,
> > in m
Hi,
I have a question related to internal redirect, I am hoping someone from
this forum can clarify. The email is a bit long since I wanted to provide
enough background for my situation.
In my module, I am creating my module context and saving some state. Some
of this state is allocated using
ttp://mdounin.ru/
___
nginx-devel mailing list -- nginx-devel@nginx.org
To unsubscribe send an email to nginx-devel-le...@nginx.org
On Fri, Jan 21, 2022 at 4:07 PM Dk Jack wrote:
> Hi,
> I have a question related to internal redirect, I am hoping som
That is exactly what I needed. Thank you.
Dk.
On Sat, Jan 22, 2022 at 11:08 AM Maxim Dounin wrote:
> Hello!
>
> On Sat, Jan 22, 2022 at 02:19:05AM -0800, Dk Jack wrote:
>
> > Maxim,
> > Thanks for responding to my query. I am passing the original context
> > p
Hi,
in my module I am inspecting the request body and making certain
decisions such as sending a 403 based on the content in the body. I based
my implementation based on the examples in the documentation and other
nginx modules.
Hi,
What is the significance of this alert in ngx_http_close_request
if (r->count == 0) {
ngx_log_error(NGX_LOG_ALERT, c->log, 0, "http request count is
zero");
}
I am seeing this alert in my logs in some cases.
Dk.
___
nginx-devel
Maxim,
I am noticing this with our modules. Although, we do not do not message
with any nginx reference counting etc.
At most, we are sending 403-forbidden for some requests. Could you suggest
some ways about debugging this?
Thanks.
Bhasker.
Forgot to add, this is with nginx version: 1.20.1
On Tue, Jul 26, 2022 at 7:21 PM Dk Jack wrote:
> Hi,
> I am noticing a crash in my nginx module. The crash is happening after an
> internal redirect. It's not always happening but for certain requests.
> Besides the trace log I do n
Hi,
I am noticing a crash in my nginx module. The crash is happening after an
internal redirect. It's not always happening but for certain requests.
Besides the trace log I do not have much info about the request. In my
module, I am restoring the my module context in a similar fashion as the `
In my code I am not modifying the reference count. Could you let me if there
any function calls if invoked would indirectly update the reference count?
Dk.
> On Jul 27, 2022, at 6:35 AM, Maxim Dounin wrote:
>
> Hello!
>
>> On Tue, Jul 26, 2022 at 07:21:29PM -0700, Dk Jac
Jul 27, 2022, at 8:05 PM, Maxim Dounin wrote:
>
> Hello!
>
>> On Wed, Jul 27, 2022 at 08:40:41AM -0700, Dk Jack wrote:
>>
>> In my code I am not modifying the reference count. Could you let
>> me if there any function calls if invoked would indir
Hi,
In my module I have a body filter. In the body filter, I respond with a 4XX
if the body contains a matching pattern. This is working correctly.
However, I would like to send a custom response message when the above
situation occurs. I tried doing this by attaching a buffer to the output
Thanks Dounin,
After stepping through the code, I came to the same conclusion but wanted
to check just in case I missed something. Thanks for the help.
-Dk
On Fri, Sep 30, 2022 at 2:32 AM Maxim Dounin wrote:
> Hello!
>
> On Thu, Sep 29, 2022 at 04:47:43PM -0700, Dk Jack wrote:
llo!
>
> On Tue, May 24, 2022 at 08:04:16AM -0700, Dk Jack wrote:
>
> > I am noticing this with our modules. Although, we do not do not message
> > with any nginx reference counting etc.
> > At most, we are sending 403-forbidden for some requests. Could you
> sugg
58 matches
Mail list logo