Немного замысловато звучит :<font size="2">) Какое-то странное поведение хендлера обнаружил.<br><br>Небольшое введение: модуль - каркас с двумя переменными &quot;blabla&quot; и &quot;blabla_disable&quot;. Действия модуля распростроняется на все сервера, кроме тех locations, где будет &quot;blabla_disable on&quot;<br>

Поэтому используется конфигурация уровня location и </font><font size="2">server. Такого я правда пока ни в одном модуле не встречал.</font><br><font style="font-family: courier new,monospace;" size="2"><br></font><font style="font-family: courier new,monospace;" size="2">static ngx_http_module_t  ngx_http_blabla_module_ctx = {<br>

    NULL,                             /* preconfiguration */<br>    ngx_http_blabla_init,             /* postconfiguration */<br><br>    NULL,                             /* create main configuration */<br>    NULL,                             /* init main configuration */<br>

<br>    ngx_http_blabla_create_srv_conf,  /* create server configuration */<br>    ngx_http_blabla_merge_srv_conf,   /* merge server configuration */<br><br>    ngx_http_blabla_create_loc_conf,  /* create location configration */<br>

    ngx_http_blabla_merge_loc_conf    /* merge location configration */<br>};</font><br><br>В ините добавляется ngx_http_blabla_handler. Пока всё стандартно.<br>Самое интересное поведение - в хендлере:<br><font size="2"><br>

</font><font size="2"><span style="font-family: courier new,monospace;">static ngx_int_t</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">ngx_http_blabla_handler(ngx_http_request_t *r)</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">{</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    ngx_http_blabla_srv_conf_t *conf;</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">    ngx_http_blabla_loc_conf_t *confl;</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    conf = ngx_http_get_module_srv_conf(r, ngx_http_blabla_module);</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">    confl = ngx_http_get_module_loc_conf(r, ngx_http_blabla_module);</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">    if (confl-&gt;disable) {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        return NGX_DECLINED;</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">    }</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    /*  Future logic */</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">    return NGX_DECLINED;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">}</span><br></font><br>Задумано так, что берется конфигурация переменных уровня сервера и уровня локейшена для запроса.<br>

Проверяется что в этом локейшене <font size="2">&quot;blabla_disable on&quot; и ничего не делается. Во всех остальных случаях идет дальше на обработку.<br>Но в реальности &quot;blabla_disable&quot; проверяется того же уровня, где расположена переменная &quot;blabla&quot;.<br>

Как пример, запрос идет на /tamtam И модуль должен пропустить этот запрос. (в реальности это редкий случай, поэтому по умолчанию в<span style="font-family: arial,helvetica,sans-serif;">езде &quot;</span></font><font style="font-family: arial,helvetica,sans-serif;" size="2">blabla_disable off&quot;</font><font size="2">)<br>

<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">server {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    blabla &quot;test&quot;;</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">    //blabla_disable off;<br><br style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;">    location /tamtam {</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">        blabla_disable on;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    }</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">}</span><br><br></font>Почему <font style="font-family: arial,helvetica,sans-serif;" size="2">&quot;ngx_http_get_module_loc_conf&quot; </font>берет данные не для запрашиваемого локейшена, а от того места, где идет инициализация хендлера и переменной &quot;blabla&quot;?<br>