<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>utgwkk</author_name>
  <author_url>https://blog.hatena.ne.jp/utgwkk/</author_url>
  <blog_title>私が歌川です</blog_title>
  <blog_url>https://blog.utgw.net/</blog_url>
  <categories>
    <anon>技術</anon>
  </categories>
  <description>tl;dr access_log には変数を使えるけど制約が多い。error_log には使えない。ホスト名の数だけ server directiveを列挙した方が早そう。 nginx 1.21.1 で確認した。 変数を使えるかどうか 表題のことが気になったので調べた。部内k8sクラスタにアプリケーションをデプロイする際に、ホスト名を列挙するだけで同じようなnginxの設定を反映できるようにしたい、そしてアクセスログやエラーログをホスト名ごとに分けたい、という経緯である。つまり以下のように書けるとありがたい。 server { listen [::]:443 ssl http2; server…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.utgw.net%2Fentry%2F2022%2F04%2F25%2F203240&quot; title=&quot;nginxのaccess_logとerror_logのログファイル名に変数を使えるかどうか - 私が歌川です&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></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-04-25 20:32:40</published>
  <title>nginxのaccess_logとerror_logのログファイル名に変数を使えるかどうか</title>
  <type>rich</type>
  <url>https://blog.utgw.net/entry/2022/04/25/203240</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
