From e76f80836ed35e105bb083c646d51c8b5ce05f81 Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Fri, 14 May 2021 23:19:32 +0300
Subject: [PATCH] Add Kibana and Elasticsearch.

---
 conf.d/elasticsearch.shore.co.il.conf | 28 ++++++++++++++++++++++++++
 conf.d/kibana.shore.co.il.conf        | 29 +++++++++++++++++++++++++++
 docker-compose.yml                    |  2 ++
 3 files changed, 59 insertions(+)
 create mode 100644 conf.d/elasticsearch.shore.co.il.conf
 create mode 100644 conf.d/kibana.shore.co.il.conf

diff --git a/conf.d/elasticsearch.shore.co.il.conf b/conf.d/elasticsearch.shore.co.il.conf
new file mode 100644
index 0000000..051d4ba
--- /dev/null
+++ b/conf.d/elasticsearch.shore.co.il.conf
@@ -0,0 +1,28 @@
+map $host $es { default elasticsearch; }
+
+server {
+    listen      80;
+    listen      [::]:80;
+    server_name elasticsearch.shore.co.il;
+    include     snippets/robots-disallow-all.conf;
+    include     snippets/ads-txt.conf;
+    include     snippets/security-txt.conf;
+    include     snippets/www-acme-challenge.conf;
+    include     snippets/redirect-https.conf;
+}
+
+server {
+    listen      443 ssl http2;
+    listen      [::]:443 ssl http2;
+    server_name elasticsearch.shore.co.il;
+    include     snippets/robots-disallow-all.conf;
+    include     snippets/ads-txt.conf;
+    include     snippets/security-txt.conf;
+    include     snippets/ssl.conf;
+
+    location / {
+        proxy_pass              http://$es:9200$request_uri;
+        proxy_http_version      1.1;
+        include                 snippets/allow-shore-ips.conf;
+    }
+}
diff --git a/conf.d/kibana.shore.co.il.conf b/conf.d/kibana.shore.co.il.conf
new file mode 100644
index 0000000..d45ddb7
--- /dev/null
+++ b/conf.d/kibana.shore.co.il.conf
@@ -0,0 +1,29 @@
+map $host $kibana { default kibana; }
+
+server {
+    listen      80;
+    listen      [::]:80;
+    server_name kibana.shore.co.il;
+    include     snippets/robots-disallow-all.conf;
+    include     snippets/ads-txt.conf;
+    include     snippets/security-txt.conf;
+    include     snippets/www-acme-challenge.conf;
+    include     snippets/redirect-https.conf;
+}
+
+server {
+    listen      443 ssl http2;
+    listen      [::]:443 ssl http2;
+    server_name kibana.shore.co.il;
+    include     snippets/robots-disallow-all.conf;
+    include     snippets/ads-txt.conf;
+    include     snippets/security-txt.conf;
+    include     snippets/ssl.conf;
+    include     snippets/vouch.conf;
+
+    location / {
+        proxy_pass              http://$kibana:5601$request_uri;
+        proxy_http_version      1.1;
+        include                 snippets/proxy-headers.conf;
+    }
+}
diff --git a/docker-compose.yml b/docker-compose.yml
index 2c6a590..698fbe6 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -11,7 +11,9 @@ services:
         aliases:
           - *hostname
           - code.shore.co.il
+          - elasticsearch.shore.co.il
           - git.shore.co.il
+          - kibana.shore.co.il
           - lam.shore.co.il
           - mta-sts.shore.co.il
           - sogo.shore.co.il
-- 
GitLab