You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何禁用Quarkus Web应用中的q/arc端点及暴露的CDI相关扩展

解决Quarkus 404页面暴露不必要端点的问题
  • 完全禁用404端点列表功能
    在application.properties中添加配置,直接关闭自动列出端点的特性:

    quarkus.http.error-page.404.auto-list-endpoints=false
    
  • 仅隐藏特定端点(保留列表功能)
    若需要保留404页面的端点列表,但移除CDI/arc相关端点,通过配置排除指定路径:

    quarkus.http.endpoints.exclude=/q/arc/*
    

    如有其他需隐藏的CDI扩展端点,用逗号追加路径即可:

    quarkus.http.endpoints.exclude=/q/arc/*,/q/xxx/*
    
  • 额外优化:限制健康端点访问
    针对已集成的quarkus-smallrye-health,可配置访问权限避免公开暴露:

    quarkus.smallrye-health.path=/health
    quarkus.http.auth.permission.health.paths=/health/*
    quarkus.http.auth.permission.health.policy=authenticated
    

内容的提问来源于stack exchange,提问作者Sujal Mandal

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.26 09:42:19