diff --git a/.gitignore b/.gitignore index 69c24f9e..e08d4224 100644 --- a/.gitignore +++ b/.gitignore @@ -3,8 +3,7 @@ data/conf/sogo/sieve.creds data/conf/dovecot/dovecot-master.passwd mailcow.conf mailcow.conf_backup -data/conf/nginx/listen*active -data/conf/nginx/server_name.active +data/conf/nginx/*active data/conf/postfix/sql data/conf/dovecot/sql data/conf/nextcloud-*.bak diff --git a/data/conf/nginx/site.conf b/data/conf/nginx/site.conf index 8a896264..bb2ea266 100644 --- a/data/conf/nginx/site.conf +++ b/data/conf/nginx/site.conf @@ -7,13 +7,6 @@ map $http_x_forwarded_proto $client_req_scheme { https https; } -server { - listen 80 default_server; - listen [::]:80 default_server; - include /etc/nginx/conf.d/server_name.active; - return 301 https://$host$request_uri; -} - server { include /etc/nginx/mime.types; charset utf-8; @@ -50,7 +43,7 @@ server { set_real_ip_from 10.0.0.0/8; set_real_ip_from 172.16.0.0/12; set_real_ip_from 192.168.0.0/16; - set_real_ip_from fd00::/8; + set_real_ip_from fc00::/7; real_ip_header X-Forwarded-For; real_ip_recursive on; @@ -108,7 +101,7 @@ server { } location ^~ /Microsoft-Server-ActiveSync { - proxy_pass http://sogo:20000/SOGo/Microsoft-Server-ActiveSync; + include /etc/nginx/conf.d/sogo_eas.active; proxy_connect_timeout 1000; proxy_next_upstream timeout error; proxy_send_timeout 1000; @@ -130,7 +123,7 @@ server { } location ^~ /SOGo { - proxy_pass http://sogo:20000; + include /etc/nginx/conf.d/sogo.active; 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; @@ -232,7 +225,7 @@ server { set_real_ip_from 10.0.0.0/8; set_real_ip_from 172.16.0.0/12; set_real_ip_from 192.168.0.0/16; - set_real_ip_from fd00::/8; + set_real_ip_from fc00::/7; real_ip_header X-Forwarded-For; real_ip_recursive on; @@ -290,7 +283,7 @@ server { } location ^~ /Microsoft-Server-ActiveSync { - proxy_pass http://sogo:20000/SOGo/Microsoft-Server-ActiveSync; + include /etc/nginx/conf.d/templates/sogo_eas.template; proxy_connect_timeout 1000; proxy_next_upstream timeout error; proxy_send_timeout 1000; @@ -312,7 +305,7 @@ server { } location ^~ /SOGo { - proxy_pass http://sogo:20000; + include /etc/nginx/conf.d/sogo.active; 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; diff --git a/data/conf/nginx/templates/sogo.template b/data/conf/nginx/templates/sogo.template new file mode 100644 index 00000000..2c084389 --- /dev/null +++ b/data/conf/nginx/templates/sogo.template @@ -0,0 +1 @@ +proxy_pass http://${IPV4_NETWORK}.248:20000; diff --git a/data/conf/nginx/templates/sogo_eas.template b/data/conf/nginx/templates/sogo_eas.template new file mode 100644 index 00000000..3cea9f98 --- /dev/null +++ b/data/conf/nginx/templates/sogo_eas.template @@ -0,0 +1 @@ +proxy_pass http://${IPV4_NETWORK}.248:20000/SOGo/Microsoft-Server-ActiveSync;