fix: sitemap.xmlのContent-Typeを application/xml; charset=utf-8 に明示 (v8.5.9-a)
Helm Chart Release / release-chart (push) Successful in 7s
Helm Chart Release / release-chart (push) Successful in 7s
標準のmime.typesでは .xml が text/xml 扱いとなりcharsetが付与されず、
ブラウザやGoogle Search Consoleなどのツールが正しく解釈できない
場合があった。
templates/configmap.yaml のnginx設定に location = /sitemap.xml を
追加し、types {} + default_type で明示的にContent-Typeを指定する
ようにした。静的ファイルの場合のみ有効(PHP動的生成には別途
header()指定が必要)。設定不要・常時有効。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -225,6 +225,10 @@ PHP 側では `$_ENV['KEY']` または `getenv('KEY')` で取得できます。
|
||||
| `nginx.forwardRealIP.trustedProxies` | 信頼するプロキシネットワーク | `["10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"]` |
|
||||
| `nginx.forwardRealIP.additionalTrustedProxies` | 追加の信頼プロキシ | `[]` |
|
||||
|
||||
> **📌 sitemap.xml のContent-Type**
|
||||
> `/sitemap.xml`(静的ファイルとして配置した場合)は、常に `Content-Type: application/xml; charset=utf-8` で配信されます。標準の `mime.types` では `.xml` が `text/xml` 扱いでcharsetが付かず、ブラウザやGoogle Search Consoleなどのツールが正しく解釈できない場合があるための組み込み対応です(設定不要、常時有効)。
|
||||
> なお、PHPで動的に生成する場合はこの設定は適用されません(PHP側で `header('Content-Type: application/xml; charset=utf-8');` を指定してください)。
|
||||
|
||||
## 使用例
|
||||
|
||||
### 例1: シンプルなPHPアプリケーション
|
||||
|
||||
Reference in New Issue
Block a user