springcloud版本如何访问druid监控后台

Blade 未结 3 1468
迷途小书童
迷途小书童 2021-04-09 09:54
悬赏:5
下面是druid配置文件和nginx配置文件信息,我需要怎么做才能访问到druid后台监控页面

#spring-datasource配置
spring:
  datasource:
    driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
    druid:
      initial-size: 5
      max-active: 20
      min-idle: 5
      max-wait: 60000
      validation-query: SELECT 'x'
      # Oracle校验
      #validation-query: select 1 from dual
      validation-query-timeout: 2000
      test-on-borrow: false
      test-on-return: false
      test-while-idle: true
      time-between-eviction-runs-millis: 60000
      min-evictable-idle-time-millis: 300000
      stat-view-servlet:
        enabled: true
        login-username: blade
        login-password: blade
      web-stat-filter:
        enabled: true
        url-pattern: /*
        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
        session-stat-enable: true
        session-stat-max-count: 10
      filters: stat






#user  nobody;

worker_processes  1;


error_log  logs/error.log;

error_log  logs/error.log  warn;

#error_log  logs/error.log  info;


pid        logs/nginx.pid;



events {

    worker_connections  1024;

}



http {

    include       mime.types;

    default_type  application/octet-stream;


    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '

                      '$status $body_bytes_sent "$http_referer" '

                      '"$http_user_agent" "$http_x_forwarded_for"';


    access_log  off;


    sendfile        on;

    #tcp_nopush     on;


    keepalive_timeout  65;


    #gzip  on;

    

    upstream gateway { 

    server 127.0.0.1:8080;

    }


    server {

        listen 8000;

        server_name web;

        root html;

        location / {

        

        }

        location ^~/api {

        proxy_set_header Host $host;

        proxy_set_header X-Real-IP $remote_addr;

        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_buffering off;

        rewrite ^/api/(.*)$ /$1 break;

        proxy_pass http://gateway;

    }

    }

client_max_body_size 100m;

}


3条回答
提交回复