In my usecase I'm trying Kibana and elastic search on different server each with Nginx. After setting up while trying to access kibana url I'm getting the below error
Will it works behind nginx Server?
Here is my configuration details for Nginx
server {
listen 80;
server_name ec2-22-22-222-233.compute-1.amazonaws.com;
return 301 https://$server_name$request_uri;
}
server {
listen *:443 ;
ssl on;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
server_name ec2-22-22-222-233.compute-1.amazonaws.com;
access_log /var/log/nginx/kibana.access.log;
error_log /var/log/nginx/kibana.error.log;
location / {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/conf.d/kibana.htpasswd;
proxy_pass http://ift.tt/1RXQRFH;
}
}
**Conf file for Elastic server Nginx**
upstream elasticsearch {
server 127.0.0.1:9200;
keepalive 64;
}
server {
listen 443;
server_name ec2-53-221-113-52.compute-1.amazonaws.com;
ssl on;
ssl_certificate /etc/elasticsearch/ssl/es_domain.crt;
ssl_certificate_key /etc/elasticsearch/ssl/es_domain.key;
#access_log /var/log/nginx/elasticsearch/access.log;
#error_log /var/log/nginx/elasticsearch/error.log debug;
location / {
rewrite ^/(.*) /$1 break;
proxy_ignore_client_abort on;
proxy_pass http://localhost:9200;
proxy_redirect http://localhost:9200 ec2-53-221-113-52.compute-1.amazonaws.com/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
auth_basic "Elasticsearch Authentication";
auth_basic_user_file /etc/elasticsearch/user.pwd;
}
}
server {
listen 80;
server_name ec2-53-221-113-52.compute-1.amazonaws.com;
return 301 https://$host$request_uri;
}
server {
listen 8001;
server_name ec2-53-221-113-52.compute-1.amazonaws.com;
return 301 https://$host$request_uri;
}
Aucun commentaire:
Enregistrer un commentaire