- 在elasticsearch域的同一vpc下开一台ec2机器,安装nginx
- 准备ssl证书
- 配置nginx如下
server {
listen 443 ssl http2;
server_name $host;
rewrite ^/$ https://$host/_plugin/kibana redirect;
ssl_certificate /path/to/fullchain.pem;
ssl_certificate_key /path/to/privkey.pem;
add_header Strict-Transport-Security max-age=2592000;
location /_plugin/kibana {
# Forward requests to Kibana
proxy_pass https://$ES_endpoint/_plugin/kibana;
proxy_pass_header Server;
proxy_cookie_domain $ES_endpoint $host;
proxy_cookie_path / /_plugin/kibana/;
proxy_buffering off;
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_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
}
}
# HTTP server
server {
listen 80;
listen [::]:80;
server_name $host;
return 301 https://$host$request_uri;
}
- 启动nginx并访问