文章 / 部署与运维 / caddy 代理 minio静态页面的一些问题

caddy 代理 minio静态页面的一些问题

caddy在使用reverse_proxy 代理到minio时,try_files会失效 返回minio的404页面

2025年4月18日1 min297 words
caddy 代理 minio静态页面的一些问题
图 1-1 cover.webp

问题描述

caddy在使用reverse_proxy 代理到minio时,try_files会失效 返回minio的404页面

解决思路

使用handle_response拦截minio的返回,如果为404则尝试重定向到index.html

xxx.com {
      rewrite *  /buckets/{path}
      reverse_proxy    https://minio.website:9000 {
          @404 status 404 
		  handle_response @404 {
			  rewrite /* /buckets/index.html
			  reverse_proxy https://minio.website:9000
		  }
      }
}

评论 (0)

加载评论中...
RELATED NOTES
05 entries
01n8n 技术实践(三):自托管、扩展、安全与可观测性阅读文章 →02n8n 技术实践(二):把 Webhook 与 API 工作流做成生产级阅读文章 →03docker镜像资源阅读文章 →04mcp服务的node实现阅读文章 →05kafka阅读文章 →