
하나의 nginx 규칙을 설정했습니다.
location ~ /(sitemap.*) {
alias /var/www/html/sitemaps/$1;
}
이것은 내가 예를 들어 원하는 경우에 효과적입니다.
- https://example.com/sitemap-1.xml
- /var/www/html/sitemaps/sitemap-1.xml 파일을 반환합니다.
content-type: text/plain
내 문제는 응답 헤더의 콘텐츠 유형이 xml 파일에 맞지 않고 올바르지 않다는 것입니다.
nginx가 콘텐츠 유형을 자동으로 이해하고 적절한 헤더를 반환하는 방법은 무엇입니까?