diff --git a/docker/nocobase/nocobase-docs.conf b/docker/nocobase/nocobase-docs.conf index 62225f566cb..8bd43675362 100644 --- a/docker/nocobase/nocobase-docs.conf +++ b/docker/nocobase/nocobase-docs.conf @@ -51,6 +51,22 @@ server { etag off; } + # 专门针对 txt 文件的路由 + location ~ \.txt$ { + root /app/nocobase/docs; + + # 清空默认的 types 映射,强制指定带有 charset 的 Content-Type + types { } + default_type "text/plain; charset=utf-8"; + + # 保持原有的头部控制逻辑 + add_header Last-Modified $date_gmt; + add_header Cache-Control 'no-store, no-cache'; + if_modified_since off; + expires off; + etag off; + } + location / { root /app/nocobase/docs; try_files $uri $uri.html $uri/index.html /index.html;