Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files51 unmodified lines52535455565758596061626364655 unmodified lines71727374757677782 unmodified lines81828384858687888990919293949551 unmodified lineslisten 7860 default_server;\n\server_name _;\n\\n\# 默认需要认证\n\auth_basic "Restricted Access";\n\auth_basic_user_file /etc/nginx/.htpasswd;\n\\n\# 文件上传限制\n\client_max_body_size 500M;\n\\n\# 静态文件目录)\n\location ~ ^/(demo|file|static)/ {\n\auth_basic off;\n\proxy_pass http://127.0.0.1:8012;\n\5 unmodified linesproxy_read_timeout 300s;\n\}\n\\n\# 反向代理到 KKFileView\n\location / {\n\proxy_pass http://127.0.0.1:8012;\n\proxy_set_header Host $http_host;\n\proxy_set_header X-Real-IP $remote_addr;\n\2 unmodified linesproxy_buffering off;\n\proxy_read_timeout 300s;\n\}\n\\n\# 健康检查端点\n\location /health {\n\auth_basic off;\n\return 200 "OK";\n\add_header Content-Type text/plain;\n\}\n\}\n' > /etc/nginx/conf.d/kkfileview.conf# 6. 启动脚本RUN printf '#!/bin/bash\n\set -e\n\51 unmodified lines5253545556575859605 unmodified lines666768697071727374757677787980818283848586878889909192939495969798991001011021032 unmodified lines10610710810911011111211351 unmodified lineslisten 7860 default_server;\n\server_name _;\n\\n\client_max_body_size 500M;\n\\n\# 静态文件目录\n\location ~ ^/(demo|file|static)/ {\n\auth_basic off;\n\proxy_pass http://127.0.0.1:8012;\n\5 unmodified linesproxy_read_timeout 300s;\n\}\n\\n\# 健康检查端点\n\location /health {\n\auth_basic off;\n\return 200 "OK";\n\add_header Content-Type text/plain;\n\}\n\\n\# 主要预览路径 - 基于 Referer 白名单\n\location / {\n\set $auth_required "Restricted Access";\n\\n\# 替换为域名\n\if ($http_referer ~* "^https?://.*\\.cloudpaste\\.qzz\\.io") {\n\set $auth_required off;\n\}\n\\n\# 部署在 HuggingFace Spaces\n\if ($http_referer ~* "^https?://.*\\.hf\\.space") {\n\set $auth_required off;\n\}\n\\n\# 开发环境支持\n\if ($http_referer ~* "^https?://localhost") {\n\set $auth_required off;\n\}\n\if ($http_referer ~* "^https?://127\\.0\\.0\\.1") {\n\set $auth_required off;\n\}\n\\n\auth_basic $auth_required;\n\auth_basic_user_file /etc/nginx/.htpasswd;\n\\n\proxy_pass http://127.0.0.1:8012;\n\proxy_set_header Host $http_host;\n\proxy_set_header X-Real-IP $remote_addr;\n\2 unmodified linesproxy_buffering off;\n\proxy_read_timeout 300s;\n\}\n\}\n' > /etc/nginx/conf.d/kkfileview.conf# 6. 启动脚本RUN printf '#!/bin/bash\n\set -e\n\
Dockerfile+33-15