From 0b5ee47c9527888a898bc3ce0220aa3119eb1453 Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Sat, 27 Feb 2021 00:02:57 +0200
Subject: [PATCH] sogo.shore.co.il

---
 conf.d/sogo.shore.co.il.conf | 39 ++++++++++++++++++++++++++++++++++++
 docker-compose.yml           |  1 +
 2 files changed, 40 insertions(+)
 create mode 100644 conf.d/sogo.shore.co.il.conf

diff --git a/conf.d/sogo.shore.co.il.conf b/conf.d/sogo.shore.co.il.conf
new file mode 100644
index 0000000..331eaf3
--- /dev/null
+++ b/conf.d/sogo.shore.co.il.conf
@@ -0,0 +1,39 @@
+map $host $sogo { default sogo; }
+
+server {
+    listen      80;
+    listen      [::]:80;
+    server_name sogo.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 sogo.shore.co.il;
+    include     snippets/robots-disallow-all.conf;
+    include     snippets/ads-txt.conf;
+    include     snippets/security-txt.conf;
+    include     snippets/ssl.conf;
+
+    location    /       { return 301 https://$host/SOGo/; }
+    location    /SOGo   { return 301 https://$host/SOGo/; }
+    location /SOGo/ {
+        proxy_pass              http://$sogo:20000$request_uri;
+        proxy_http_version      1.1;
+        include                 snippets/proxy-headers.conf;
+        proxy_hide_header       X-Frame-Options;
+        include                 snippets/allow-private-ips.conf;
+
+        # Copied from http://wiki.sogo.nu/nginxSettings
+        proxy_set_header        x-webobjects-server-protocol HTTP/1.1;
+        proxy_set_header        x-webobjects-remote-host $sogo;
+        proxy_set_header        x-webobjects-server-name $server_name;
+        proxy_set_header        x-webobjects-server-url $scheme://$host;
+        proxy_set_header        x-webobjects-server-port $server_port;
+    }
+}
diff --git a/docker-compose.yml b/docker-compose.yml
index d215c9f..2c6a590 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -14,6 +14,7 @@ services:
           - git.shore.co.il
           - lam.shore.co.il
           - mta-sts.shore.co.il
+          - sogo.shore.co.il
           - vouch.shore.co.il
           - zpush.shore.co.il
     ports:
-- 
GitLab