location ~* .(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg |jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid |midi|wav|bmp|rtf)$ {https://www.nginx.com/blog/9-tips-for-improving-wordpress-performance-with-nginx/
$ echo "ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf" | tr "|" "\n" | sort | tr "\n" "|" atom|bmp|bz2|css|doc|eot|exe|gif|gz|ico|jpeg|jpg|js|mid|midi|mp4|ogg|ogv|otf|png|ppt|rar|rss|rtf|svg|svgz|tar|tgz|ttf|wav|woff|xls|zip|
security
# WordPress: deny general stuff location ~* ^/(?:xmlrpc\.php|wp-links-opml\.php|wp-config\.php|wp-config-sample\.php|wp-comments-post\.php|readme\.html|license\.txt)$ { deny all; }
https://gist.github.com/nfsarmento/57db5abba08b315b67f174cd178bea88
~* 正規表現(大文字・小文字を区別しない)
nginx連載5回目: nginxの設定、その3 - locationディレクティブ - インフラエンジニアway - Powered by HEARTBEATS 2012
(?:...) マッチングは通常に行われますが、マッチした文字列が \1 や $1 などにキャプチャされません。
とほほの正規表現入門 - とほほのWWW入門
#Disable execution of scripts other than PHP from your document root location ~* .(pl|cgi|py|sh|lua|asp)$ { return 444; }
nginx でステータスコード「444」を返すコードを見掛けて、なんぞや!って思って調べた
nginx の独自のステータスコードで、何も返さないでコネクションを閉じる
悪意のあるボットからのアクセスを遮断する時などに使ったりするらしい
【nginx】ステータスコード「444」 | 高木のブログ 2022