ИМХО, вы не тем занимаетесь, боритесь с XSS на backend + хидер для браузеров:
# This header enables the Cross-site scripting (XSS) filter built into most recent web browsers. # It's usually enabled by default anyway, so the role of this header is to re-enable the filter for # this particular website if it was disabled by the user. # https://www.owasp.org/index.php/List_of_useful_HTTP_headers add_header X-XSS-Protection "1; mode=block"; On Tue, Apr 23, 2019 at 9:57 AM anatolr <[email protected]> wrote: > Пытаюсь закрыть выполнение такого вида запросов к сайту > содержащих специальный символ < или > > > http://www.host.ru/index.php/> > <script>document.body.style.backgroundImage=url('http:// > .../orig_.jpg')";</script><b > > > делаю с помощью > > location ~* ^(.*)(\<)+(.*)$ { > return 404; > } > > но запрос не перехватывается код > 3C > > пробовал в hex кодe как-то так (.*)[^\3С]+(.*) > > как правильно указать в location такого вида символы? > > Прошу помогите пожайлуста как запретить такие строки в nginx? > > Posted at Nginx Forum: > https://forum.nginx.org/read.php?21,283878,283878#msg-283878 > > _______________________________________________ > nginx-ru mailing list > [email protected] > http://mailman.nginx.org/mailman/listinfo/nginx-ru -- Yours sincerely, Vladimir Getmanshchuk
_______________________________________________ nginx-ru mailing list [email protected] http://mailman.nginx.org/mailman/listinfo/nginx-ru
