Welcome! Log In Create A New Profile

Advanced

Re: enable module for specific site

June 21, 2016 10:44AM
No, is the same way.
You may create a custom directive to set if you module is activated or not
on the location.
And check this flag as the first action of your module.
What I mean is, all requests will reach your module, but only the ones
target to the location where it is "on" will handle the request, the other
on will suffer a bypass on your module.
Take a look on ngx_http_gzip_filter_module.c as a very good example ;)


On Tue, Jun 21, 2016 at 11:06 AM, Justin Kennedy <justin@justinkennedy.ca>
wrote:

> HI Wandenberg, Our module is a request filter. Do we have to do anything
> special with this type of module to make it configurable per server /
> location ? I come from the Apache world, and there we would have to make a
> custom directive, then the module would have to react to that accordingly.
> Is it different for nginx?
>
> Thank you
>
> On 20 June 2016 at 11:43, Justin Kennedy <justin@justinkennedy.ca> wrote:
>
>> I'll try to simply the question: Can a module be enabled only for
>> specific server blocks?
>>
>> I.e. If a module is "included" in server block B then it will not
>> interfere with requests on server block A (or any other).
>>
>> Please advice, thank you!
>>
>> On 8 June 2016 at 14:32, Justin Kennedy <justin@justinkennedy.ca> wrote:
>>
>>> Hello,
>>>
>>> I am developing an nginx module and one of the requirements is to enable
>>> the module only for specific sites or virtual hosts (using a directive I
>>> would suppose).
>>>
>>> Is this possible with nginx?
>>>
>>> Thank you,
>>> -Justin
>>>
>>
>>
>>
>> --
>> Justin Kennedy
>> Software Developer
>>
>>
>
>
> --
> Justin Kennedy
> Software Developer
>
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

enable module for specific site

Justin Kennedy 505 June 08, 2016 01:34PM

Re: enable module for specific site

Justin Kennedy 282 June 20, 2016 10:46AM

Re: enable module for specific site

wandenberg 391 June 20, 2016 11:30AM

Re: enable module for specific site

Justin Kennedy 286 June 21, 2016 10:08AM

Re: enable module for specific site

wandenberg 424 June 21, 2016 10:44AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

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