<div>Суть с map понятна, спасибо за ликбез, хорошая конструкция. Есть один ньюанс, судя по документации map можно применять только в контексте http, а хотелось бы в контексте server, а лучше location :(</div><div> </div><div>16.05.2016, 17:57, "Sergey V. Sokolov" <sokol@zavolga.net>:</div><blockquote type="cite"><div>Мне НЕ нужна проверка по отдельным переменным $query_string, нужно проверка сопоставления со всей строкой $query_string.</div><div> </div><div>16.05.2016, 15:20, "Иван" <<a href="mailto:nginx@kinetiksoft.com">nginx@kinetiksoft.com</a>>:</div><blockquote type="cite"><div style="font-family:Monospace;font-size:9pt;font-weight:400;font-style:normal;"><p style="margin:0px;">Вы хотите анализировать именно $query_string или конкретные переменные из нее?</p><p style="margin:0px;"> </p><p style="margin:0px;">Для приведенного Вами примера с p= работает моя конструкция. Если надо сравнивать p с несколькими подстроками, то будет</p><p style="margin:0px;"> </p><p style="margin:0px;">map $arg_p $block {</p><p style="margin:0px;">'anyqwery$' 1;</p><p style="margin:0px;">'otherqwery' 1;</p><p style="margin:0px;">'some$otherqwery' 1;</p><p style="margin:0px;">}</p><p style="margin:0px;"> </p><p style="margin:0px;">if ($block) {</p><p style="margin:0px;">return 403;</p><p style="margin:0px;">}</p><p style="margin:0px;"> </p><p style="margin:0px;">Если таких p не одна, а, например, есть еще q, то будет как-то так</p><p style="margin:0px;"> </p><p style="margin:0px;">map $arg_p $pblock {</p><p style="margin:0px;">default 0;</p><p style="margin:0px;">'anyqwery$' 1;</p><p style="margin:0px;">'otherqwery' 1;</p><p style="margin:0px;">'some$otherqwery' 1;</p><p style="margin:0px;">}</p><p style="margin:0px;">map $arg_q $qblock {</p><p style="margin:0px;">default 0;</p><p style="margin:0px;">'2qwery$' 1;</p><p style="margin:0px;">'newotherqwery' 1;</p><p style="margin:0px;">'3some$otherqwery$' 1;</p><p style="margin:0px;">}</p><p style="margin:0px;"> </p><p style="margin:0px;">map $pblock$qblock $block {</p><p style="margin:0px;">default 1;</p><p style="margin:0px;">00 0;</p><p style="margin:0px;">}</p><p style="margin:0px;"> </p><p style="margin:0px;">if ($block) {</p><p style="margin:0px;">return 403;</p><p style="margin:0px;">}</p><p style="margin:0px;"> </p><p style="margin:0px;">Если же переменных p,q много, то можно сделать регэкспом по всей $query_string:</p><p style="margin:0px;"> </p><p style="margin:0px;">map $query_string $block {</p><p style="margin:0px;">default 0;</p><p style="margin:0px;">~'p=anyqwery$' 1; #если $query_string содержит "p=anyqwery$" или "zap=anyqwery$otherqwery", будет отлуп</p><p style="margin:0px;">~'otherqwery' 1;</p><p style="margin:0px;">~'$$$' 1;</p><p style="margin:0px;">}</p><p style="margin:0px;"> </p><p style="margin:0px;">if ($block) {</p><p style="margin:0px;">return 403;</p><p style="margin:0px;">}</p><p style="margin:0px;"> </p><p style="margin:0px;">Прочитайте документацию на map: <a href="http://nginx.org/r/map/ru">http://nginx.org/r/map/ru</a>.</p><p style="margin:0px;"> </p><p style="margin:0px;">В письме от 16 мая 2016 14:46:12 пользователь Sergey V. Sokolov написал:</p><p style="margin:0px;">> Мне нужно для одного из location заблокировать порядка 10-20 query_string, а</p><p style="margin:0px;">> остальные пропустить. Так вот, query_string может содержать символ $ и</p><p style="margin:0px;">> нужно это учесть.</p><p style="margin:0px;">> 16.05.2016, 14:07, "Иван" <<a href="mailto:nginx@kinetiksoft.com">nginx@kinetiksoft.com</a>>:</p><p style="margin:0px;">> Мне кажется, что нет, не правильно понимаете. Опишите конкретнее, что хотите</p><p style="margin:0px;">> получить, пожалуйста.</p><p style="margin:0px;">></p><p style="margin:0px;">> В письме от 16 мая 2016 14:05:52 пользователь Sergey V. Sokolov написал:</p><p style="margin:0px;">> > Я правильно понимаю, что на каждую такую операцию сравнения, будет две</p><p style="margin:0px;">> > директивы в конфиге map и if? Получается в две операции. Короче можно?</p><p style="margin:0px;">> > 16.05.2016, 02:57, "Иван" <<a href="mailto:nginx@kinetiksoft.com">nginx@kinetiksoft.com</a>>:</p><p style="margin:0px;">> ></p><p style="margin:0px;">> > В письме от 16 мая 2016 01:47:12 пользователь Sergey V. Sokolov написал:</p><p style="margin:0px;">> > > $query_string</p><p style="margin:0px;">> ></p><p style="margin:0px;">> >  </p><p style="margin:0px;">> > Здравствуйте!</p><p style="margin:0px;">> >  </p><p style="margin:0px;">> > Наиболее правильно</p><p style="margin:0px;">> > map $arg_p $block {</p><p style="margin:0px;">> > 'anyqwery$' 1;</p><p style="margin:0px;">> > }</p><p style="margin:0px;">> >  </p><p style="margin:0px;">> > if ($block) {</p><p style="margin:0px;">> > return 403;</p><p style="margin:0px;">> > }</p><p style="margin:0px;">> >  </p><p style="margin:0px;">> > С уважением, Иван.</p><p style="margin:0px;">> > ,</p><p style="margin:0px;">> > _______________________________________________</p><p style="margin:0px;">> > nginx-ru mailing list</p><p style="margin:0px;">> > <a href="mailto:nginx-ru@nginx.org">nginx-ru@nginx.org</a></p><p style="margin:0px;">> > <a href="http://mailman.nginx.org/mailman/listinfo/nginx-ru">http://mailman.nginx.org/mailman/listinfo/nginx-ru</a></p><p style="margin:0px;">> ></p><p style="margin:0px;">> >  </p><p style="margin:0px;">> >  </p><p style="margin:0px;">> > --</p><p style="margin:0px;">> > С уважением, Сергей Соколов</p><p style="margin:0px;">> > Заместитель директора</p><p style="margin:0px;">> > Zavolga.Net (ООО "Горизонт"), г. Ярославль</p><p style="margin:0px;">> > Тел.: <span><span>+7 4852 333-402</span></span></p><p style="margin:0px;">> > Сайт: <a href="http://zavolga.net/">http://zavolga.net</a></p><p style="margin:0px;">> >  </p><p style="margin:0px;">> > Руководитель проекта</p><p style="margin:0px;">> > Региональный Интернет Дневник</p><p style="margin:0px;">> > Сайт: <a href="http://dnevnik76.ru/">http://dnevnik76.ru</a> </p><p style="margin:0px;">> >  </p><p style="margin:0px;">> > Руководитель проекта</p><p style="margin:0px;">> > Ярославский Internet Exchange (YAR-IX)</p><p style="margin:0px;">> > Сайт: <a href="http://yar-ix.net/">http://yar-ix.net</a></p><p style="margin:0px;">> ></p><p style="margin:0px;">> > nic-hdl: SVS141-RIPE</p><p style="margin:0px;">> > X-NCC-RegID: ru.gorizont</p><p style="margin:0px;">> >  </p><p style="margin:0px;">></p><p style="margin:0px;">>  </p><p style="margin:0px;">> ,</p><p style="margin:0px;">> _______________________________________________</p><p style="margin:0px;">> nginx-ru mailing list</p><p style="margin:0px;">> <a href="mailto:nginx-ru@nginx.org">nginx-ru@nginx.org</a></p><p style="margin:0px;">> <a href="http://mailman.nginx.org/mailman/listinfo/nginx-ru">http://mailman.nginx.org/mailman/listinfo/nginx-ru</a></p><p style="margin:0px;">></p><p style="margin:0px;">>  </p><p style="margin:0px;">>  </p><p style="margin:0px;">> --</p><p style="margin:0px;">> С уважением, Сергей Соколов</p><p style="margin:0px;">> Заместитель директора</p><p style="margin:0px;">> Zavolga.Net (ООО "Горизонт"), г. Ярославль</p><p style="margin:0px;">> Тел.: <span><span>+7 4852 333-402</span></span></p><p style="margin:0px;">> Сайт: <a href="http://zavolga.net/">http://zavolga.net</a></p><p style="margin:0px;">>  </p><p style="margin:0px;">> Руководитель проекта</p><p style="margin:0px;">> Региональный Интернет Дневник</p><p style="margin:0px;">> Сайт: <a href="http://dnevnik76.ru/">http://dnevnik76.ru</a> </p><p style="margin:0px;">>  </p><p style="margin:0px;">> Руководитель проекта</p><p style="margin:0px;">> Ярославский Internet Exchange (YAR-IX)</p><p style="margin:0px;">> Сайт: <a href="http://yar-ix.net/">http://yar-ix.net</a></p><p style="margin:0px;">></p><p style="margin:0px;">> nic-hdl: SVS141-RIPE</p><p style="margin:0px;">> X-NCC-RegID: ru.gorizont</p><p style="margin:0px;">>  </p><p style="margin:0px;"> </p></div>,<p>_______________________________________________<br />nginx-ru mailing list<br /><a href="mailto:nginx-ru@nginx.org">nginx-ru@nginx.org</a><br /><a href="http://mailman.nginx.org/mailman/listinfo/nginx-ru">http://mailman.nginx.org/mailman/listinfo/nginx-ru</a></p></blockquote><div> </div><div> </div><div>-- <br />С уважением, Сергей Соколов<br />Заместитель директора<br />Zavolga.Net (ООО "Горизонт"), г. Ярославль<br />Тел.: <span>+7 4852 333-402</span><br />Сайт: <a href="http://zavolga.net/">http://zavolga.net</a></div><div> </div><div>Руководитель проекта<br />Региональный Интернет Дневник<br />Сайт: <a href="http://dnevnik76.ru/">http://dnevnik76.ru</a> </div><div> </div><div>Руководитель проекта</div><div>Ярославский Internet Exchange (YAR-IX)</div><div>Сайт: <a href="http://yar-ix.net/">http://yar-ix.net</a><br /><br />nic-hdl: SVS141-RIPE<br />X-NCC-RegID: ru.gorizont</div><div> </div>,<p>_______________________________________________<br />nginx-ru mailing list<br /><a href="mailto:nginx-ru@nginx.org">nginx-ru@nginx.org</a><br /><a href="http://mailman.nginx.org/mailman/listinfo/nginx-ru">http://mailman.nginx.org/mailman/listinfo/nginx-ru</a></p></blockquote><div> </div><div> </div><div>-- <br />С уважением, Сергей Соколов<br />Заместитель директора<br />Zavolga.Net (ООО "Горизонт"), г. Ярославль<br />Тел.: +7 4852 333-402<br />Сайт: http://zavolga.net</div><div> </div><div>Руководитель проекта<br />Региональный Интернет Дневник<br />Сайт: http://dnevnik76.ru </div><div> </div><div>Руководитель проекта</div><div>Ярославский Internet Exchange (YAR-IX)</div><div>Сайт: http://yar-ix.net<br /><br />nic-hdl: SVS141-RIPE<br />X-NCC-RegID: ru.gorizont</div><div> </div>