简介: druid 连接池监控报错 Sorry, you are not permitted to view this page.

使用Druid连接池的时候,遇到一个奇怪的问题,在本地(localhost)可以直接打开Druid连接池监控,在其他机器上打开会报错: Sorry, you are not permitted to view this page

解决:

在druid wiki上有如下描述

判断规则

  • deny优先于allow,如果在deny列表中,就算在allow列表中,也会被拒绝。
  • 如果allow没有配置或者为空,则允许所有访问

 添加如下配置:

spring.datasource.druid.stat-view-servlet.allow=

更多推荐