瀏覽代碼

Change Nginx templates

andryyy 8 年之前
父節點
當前提交
6d7c3423ba

+ 1 - 0
data/conf/nginx/server_name.active

@@ -0,0 +1 @@
+server_name logs.servercow.de autodiscover.* autoconfig.*;

+ 3 - 3
data/conf/nginx/site.conf

@@ -13,7 +13,7 @@ server {
   add_header Strict-Transport-Security "max-age=15768000; includeSubDomains";
   ssl_ecdh_curve secp384r1;
   index index.php index.html;
-  server_name _ autodiscover.* autoconfig.*;
+  include /etc/nginx/conf.d/server_name.active;
   error_log  /var/log/nginx/error.log;
   access_log /var/log/nginx/access.log;
   root /web;
@@ -148,7 +148,7 @@ server {
   charset utf-8;
   override_charset on;
   index index.php index.html;
-  server_name _ autodiscover.* autoconfig.*;
+  include /etc/nginx/conf.d/server_name.active;
   error_log  /var/log/nginx/error.log;
   access_log /var/log/nginx/access.log;
   root /web;
@@ -277,4 +277,4 @@ server {
     #alias /usr/lib/GNUstep/SOGo/$1.SOGo/Resources/$2;
   }
 
-}
+}

+ 0 - 0
data/conf/nginx/listen_plain.template → data/conf/nginx/templates/listen_plain.template


+ 0 - 0
data/conf/nginx/listen_ssl.template → data/conf/nginx/templates/listen_ssl.template


+ 1 - 0
data/conf/nginx/templates/server_name.template

@@ -0,0 +1 @@
+server_name ${MAILCOW_HOSTNAME} autodiscover.* autoconfig.*;

+ 4 - 2
docker-compose.yml

@@ -242,12 +242,14 @@ services:
         - sogo-mailcow
         - php-fpm-mailcow
       image: nginx:mainline
-      command: /bin/bash -c "envsubst < /etc/nginx/conf.d/listen_plain.template > /etc/nginx/conf.d/listen_plain.active &&
-        envsubst < /etc/nginx/conf.d/listen_ssl.template > /etc/nginx/conf.d/listen_ssl.active &&
+      command: /bin/bash -c "envsubst < /etc/nginx/conf.d/templates/listen_plain.template > /etc/nginx/conf.d/listen_plain.active &&
+        envsubst < /etc/nginx/conf.d/templates/listen_ssl.template > /etc/nginx/conf.d/listen_ssl.active &&
+        envsubst < /etc/nginx/conf.d/templates/server_name.template > /etc/nginx/conf.d/server_name.active &&
         nginx -g 'daemon off;'"
       environment:
         - HTTPS_PORT=${HTTPS_PORT:-443}
         - HTTP_PORT=${HTTP_PORT:-80}
+        - MAILCOW_HOSTNAME=${MAILCOW_HOSTNAME}
       volumes:
         - ./data/web:/web:ro
         - ./data/conf/rspamd/dynmaps:/dynmaps:ro