<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mtiit</author_name>
  <author_url>https://blog.hatena.ne.jp/mtiit/</author_url>
  <blog_title>(O+P)ut</blog_title>
  <blog_url>https://www.mtioutput.com/</blog_url>
  <categories>
    <anon>Nginx</anon>
  </categories>
  <description>やりたいこと リクエストの中で指定されるURLの中に指定した文字列が入っていた場合にエラー処理を行う。 例としてAmazon Linuxにて検証を行い、&quot;a&quot;という文字列が入っていた場合に応答コード400でエラーとする。 環境情報 # nginx -v nginx version: nginx/1.25.1 (nginx-plus-r30-p1) やり方 mapディレクティブにて特定のリクエストとして&quot;a&quot;が含まれる場合の設定を行い http { ... map $request_uri $invalid_uri { default 0; &quot;~*a&quot; 1; } ... その条件の場合のエラーコ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.mtioutput.com%2Fentry%2Fnginx-urlmatch-error&quot; title=&quot;【NGINX/Linux】特定の文字列が入ったリクエストをエラーにする - (O+P)ut&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/m/mtiit/20210812/20210812171735.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2024-03-09 16:08:34</published>
  <title>【NGINX/Linux】特定の文字列が入ったリクエストをエラーにする</title>
  <type>rich</type>
  <url>https://www.mtioutput.com/entry/nginx-urlmatch-error</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
