安企CMS的llms.txt文件用谷歌浏览器打开是乱码解决方法!
如图:

代码如下:
location @AnqiCMS {
proxy_pass http://127.0.0.1:8001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
error_page 404 =200 @AnqiCMS;
location / {
try_files $uri $uri/index.html @AnqiCMS;
}
# 专门处理 .txt 结尾的文件
location ~* \.txt$ {
# 强制设置内容类型为 text/plain 并指定 UTF-8 编码
default_type text/plain;
charset utf-8;
# 如果 default_type 不生效,可以使用 add_header 强制覆盖(需配合 always)
# add_header Content-Type "text/plain; charset=utf-8" always;
}












