利用nginx來控制訪問kibana


默認的kibana是沒有任何的權限控制,假設kibana的監聽地址為本地IP 127.0.0.1,我們可以利用nginx來限制訪問kibana的IP

編輯nginx

worker_processes 1;
events {
worker_connections 999;
}
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"';
sendfile on;
keepalive_timeout 65;
server {
listen 5611; #監聽端口
access_log /usr/local/nginx/logs/kibana_access.log main;
error_log /usr/local/nginx/logs/kibana_error.log error;
location / {
allow 10.0.0.91; #許可訪問IP
deny all;
proxy_pass http://127.0.0.1:5601; #kibana的IP
}
}
}

通過配置文件修改 可以控制訪問IP和端口


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM