これも書き換えで解決できます。try_files
(ディレクティブを使用しているため、書き換えを使用して解決する必要がありました。)
これが私の設定です:
# Long cache times for static content
location ~ /_/static/(.+)$ {
# hold the last five versions of our static content
try_files
/_/static_477526f-master/$1
/_/static_05c8613-release/$1
/_/static_05c8613-master/$1
/_/static_db26497-release/$1
/_/static_db26497-master/$1;
expires 365d;
add_header Cache-Control public;
add_header Access-Control-Allow-Origin *;
}
location = /favicon.ico {
rewrite . /_/static/favicon.ico;
expires 14d;
add_header Cache-Control public;
}
正規表現は.
何でも一致し、2 番目のエントリは URL を書き換えます。これはファビコン固有の場所であるため、正規表現のキャプチャと$1
.