From eb6f79c6a93f63edc75a1ab06b30c15bcd9e0c99 Mon Sep 17 00:00:00 2001 From: myvesta Date: Mon, 23 Sep 2019 15:22:23 +0200 Subject: [PATCH] hosting legacy nginx tpl --- .../10/templates/web/nginx/hosting-legacy.sh | 11 ++++ ...sting-webmail.stpl => hosting-legacy.stpl} | 14 +---- ...hosting-webmail.tpl => hosting-legacy.tpl} | 14 +---- .../web/nginx/hosting-webmail-phpmyadmin.stpl | 62 ------------------- .../web/nginx/hosting-webmail-phpmyadmin.tpl | 59 ------------------ .../10/templates/web/nginx/hosting.stpl | 0 .../debian/10/templates/web/nginx/hosting.tpl | 0 .../10/templates/web/nginx/proxy_ip.tpl | 0 .../web/nginx/vesta-webmail-phpmyadmin.stpl | 52 ---------------- .../web/nginx/vesta-webmail-phpmyadmin.tpl | 8 --- .../debian/10/templates/web/nginx/vesta.stpl | 32 ---------- .../debian/10/templates/web/nginx/vesta.tpl | 8 --- 12 files changed, 13 insertions(+), 247 deletions(-) create mode 100755 install/debian/10/templates/web/nginx/hosting-legacy.sh rename install/debian/10/templates/web/nginx/{hosting-webmail.stpl => hosting-legacy.stpl} (68%) rename install/debian/10/templates/web/nginx/{hosting-webmail.tpl => hosting-legacy.tpl} (66%) delete mode 100644 install/debian/10/templates/web/nginx/hosting-webmail-phpmyadmin.stpl delete mode 100644 install/debian/10/templates/web/nginx/hosting-webmail-phpmyadmin.tpl mode change 100755 => 100644 install/debian/10/templates/web/nginx/hosting.stpl mode change 100755 => 100644 install/debian/10/templates/web/nginx/hosting.tpl mode change 100755 => 100644 install/debian/10/templates/web/nginx/proxy_ip.tpl delete mode 100644 install/debian/10/templates/web/nginx/vesta-webmail-phpmyadmin.stpl delete mode 100644 install/debian/10/templates/web/nginx/vesta-webmail-phpmyadmin.tpl delete mode 100644 install/debian/10/templates/web/nginx/vesta.stpl delete mode 100644 install/debian/10/templates/web/nginx/vesta.tpl diff --git a/install/debian/10/templates/web/nginx/hosting-legacy.sh b/install/debian/10/templates/web/nginx/hosting-legacy.sh new file mode 100755 index 000000000..eeed37ef9 --- /dev/null +++ b/install/debian/10/templates/web/nginx/hosting-legacy.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# Changing public_html permission +user="$1" +domain="$2" +ip="$3" +home_dir="$4" +docroot="$5" + +chmod 755 $docroot + +exit 0 diff --git a/install/debian/10/templates/web/nginx/hosting-webmail.stpl b/install/debian/10/templates/web/nginx/hosting-legacy.stpl similarity index 68% rename from install/debian/10/templates/web/nginx/hosting-webmail.stpl rename to install/debian/10/templates/web/nginx/hosting-legacy.stpl index e3b36324c..d62b5171b 100644 --- a/install/debian/10/templates/web/nginx/hosting-webmail.stpl +++ b/install/debian/10/templates/web/nginx/hosting-legacy.stpl @@ -13,19 +13,7 @@ server { access_log /var/log/%web_system%/domains/%domain%.log combined; access_log /var/log/%web_system%/domains/%domain%.bytes bytes; expires max; - # try_files $uri @fallback; - } - } - - location /webmail { - disable_symlinks off; - proxy_pass https://%ip%:%web_ssl_port%; - location ~* ^.+\.(%proxy_extentions%)$ { - root /var/lib/roundcube; - access_log /var/log/%web_system%/domains/%domain%.log combined; - access_log /var/log/%web_system%/domains/%domain%.bytes bytes; - expires max; - # try_files $uri @fallback; + try_files $uri @fallback; } } diff --git a/install/debian/10/templates/web/nginx/hosting-webmail.tpl b/install/debian/10/templates/web/nginx/hosting-legacy.tpl similarity index 66% rename from install/debian/10/templates/web/nginx/hosting-webmail.tpl rename to install/debian/10/templates/web/nginx/hosting-legacy.tpl index 976737c71..15961c95c 100644 --- a/install/debian/10/templates/web/nginx/hosting-webmail.tpl +++ b/install/debian/10/templates/web/nginx/hosting-legacy.tpl @@ -10,19 +10,7 @@ server { access_log /var/log/%web_system%/domains/%domain%.log combined; access_log /var/log/%web_system%/domains/%domain%.bytes bytes; expires max; - # try_files $uri @fallback; - } - } - - location /webmail { - disable_symlinks off; - proxy_pass https://%ip%:%web_ssl_port%; - location ~* ^.+\.(%proxy_extentions%)$ { - root /var/lib/roundcube; - access_log /var/log/%web_system%/domains/%domain%.log combined; - access_log /var/log/%web_system%/domains/%domain%.bytes bytes; - expires max; - # try_files $uri @fallback; + try_files $uri @fallback; } } diff --git a/install/debian/10/templates/web/nginx/hosting-webmail-phpmyadmin.stpl b/install/debian/10/templates/web/nginx/hosting-webmail-phpmyadmin.stpl deleted file mode 100644 index 4fadbbfcb..000000000 --- a/install/debian/10/templates/web/nginx/hosting-webmail-phpmyadmin.stpl +++ /dev/null @@ -1,62 +0,0 @@ -server { - listen %ip%:%proxy_ssl_port% ssl http2; - server_name %domain_idn% %alias_idn%; - # ssl on; - ssl_certificate %ssl_pem%; - ssl_certificate_key %ssl_key%; - error_log /var/log/%web_system%/domains/%domain%.error.log error; - - location / { - proxy_pass https://%ip%:%web_ssl_port%; - location ~* ^.+\.(%proxy_extentions%)$ { - root %sdocroot%; - access_log /var/log/%web_system%/domains/%domain%.log combined; - access_log /var/log/%web_system%/domains/%domain%.bytes bytes; - expires max; - # try_files $uri @fallback; - } - } - - location /webmail { - disable_symlinks off; - proxy_pass https://%ip%:%web_ssl_port%; - location ~* ^.+\.(%proxy_extentions%)$ { - root /var/lib/roundcube; - access_log /var/log/%web_system%/domains/%domain%.log combined; - access_log /var/log/%web_system%/domains/%domain%.bytes bytes; - expires max; - # try_files $uri @fallback; - } - } - - location /phpmyadmin { - disable_symlinks off; - proxy_pass https://%ip%:%web_ssl_port%; - location ~* ^.+\.(%proxy_extentions%)$ { - root /usr/share; - access_log /var/log/%web_system%/domains/%domain%.log combined; - access_log /var/log/%web_system%/domains/%domain%.bytes bytes; - expires max; - # try_files $uri @fallback; - } - } - - location /error/ { - alias %home%/%user%/web/%domain%/document_errors/; - } - - location @fallback { - proxy_pass https://%ip%:%web_ssl_port%; - } - - location ~ /\.ht {return 404;} - location ~ /\.svn/ {return 404;} - location ~ /\.git/ {return 404;} - location ~ /\.hg/ {return 404;} - location ~ /\.bzr/ {return 404;} - - disable_symlinks if_not_owner from=%docroot%; - - include %home%/%user%/conf/web/snginx.%domain%.conf*; -} - diff --git a/install/debian/10/templates/web/nginx/hosting-webmail-phpmyadmin.tpl b/install/debian/10/templates/web/nginx/hosting-webmail-phpmyadmin.tpl deleted file mode 100644 index 7085e047d..000000000 --- a/install/debian/10/templates/web/nginx/hosting-webmail-phpmyadmin.tpl +++ /dev/null @@ -1,59 +0,0 @@ -server { - listen %ip%:%proxy_port%; - server_name %domain_idn% %alias_idn%; - error_log /var/log/%web_system%/domains/%domain%.error.log error; - - location / { - proxy_pass http://%ip%:%web_port%; - location ~* ^.+\.(%proxy_extentions%)$ { - root %docroot%; - access_log /var/log/%web_system%/domains/%domain%.log combined; - access_log /var/log/%web_system%/domains/%domain%.bytes bytes; - expires max; - # try_files $uri @fallback; - } - } - - location /webmail { - disable_symlinks off; - proxy_pass https://%ip%:%web_ssl_port%; - location ~* ^.+\.(%proxy_extentions%)$ { - root /var/lib/roundcube; - access_log /var/log/%web_system%/domains/%domain%.log combined; - access_log /var/log/%web_system%/domains/%domain%.bytes bytes; - expires max; - # try_files $uri @fallback; - } - } - - location /phpmyadmin { - disable_symlinks off; - proxy_pass https://%ip%:%web_ssl_port%; - location ~* ^.+\.(%proxy_extentions%)$ { - root /usr/share; - access_log /var/log/%web_system%/domains/%domain%.log combined; - access_log /var/log/%web_system%/domains/%domain%.bytes bytes; - expires max; - # try_files $uri @fallback; - } - } - - location /error/ { - alias %home%/%user%/web/%domain%/document_errors/; - } - - location @fallback { - proxy_pass http://%ip%:%web_port%; - } - - location ~ /\.ht {return 404;} - location ~ /\.svn/ {return 404;} - location ~ /\.git/ {return 404;} - location ~ /\.hg/ {return 404;} - location ~ /\.bzr/ {return 404;} - - disable_symlinks if_not_owner from=%docroot%; - - include %home%/%user%/conf/web/nginx.%domain%.conf*; -} - diff --git a/install/debian/10/templates/web/nginx/hosting.stpl b/install/debian/10/templates/web/nginx/hosting.stpl old mode 100755 new mode 100644 diff --git a/install/debian/10/templates/web/nginx/hosting.tpl b/install/debian/10/templates/web/nginx/hosting.tpl old mode 100755 new mode 100644 diff --git a/install/debian/10/templates/web/nginx/proxy_ip.tpl b/install/debian/10/templates/web/nginx/proxy_ip.tpl old mode 100755 new mode 100644 diff --git a/install/debian/10/templates/web/nginx/vesta-webmail-phpmyadmin.stpl b/install/debian/10/templates/web/nginx/vesta-webmail-phpmyadmin.stpl deleted file mode 100644 index 66d213393..000000000 --- a/install/debian/10/templates/web/nginx/vesta-webmail-phpmyadmin.stpl +++ /dev/null @@ -1,52 +0,0 @@ -server { - listen %ip%:%proxy_ssl_port% ssl http2; - server_name %domain_idn% %alias_idn%; - # ssl on; - ssl_certificate %ssl_pem%; - ssl_certificate_key %ssl_key%; - error_log /var/log/%web_system%/domains/%domain%.error.log error; - access_log /var/log/%web_system%/domains/%domain%.log combined; - - location / { - proxy_pass https://%ip%:12383; - } - - location /webmail { - disable_symlinks off; - proxy_pass https://%ip%:%web_ssl_port%; - location ~* ^.+\.(%proxy_extentions%)$ { - root /var/lib/roundcube; - access_log /var/log/%web_system%/domains/%domain%.log combined; - access_log /var/log/%web_system%/domains/%domain%.bytes bytes; - expires max; - # try_files $uri @fallback; - } - } - - location /phpmyadmin { - disable_symlinks off; - proxy_pass https://%ip%:%web_ssl_port%; - location ~* ^.+\.(%proxy_extentions%)$ { - root /usr/share; - access_log /var/log/%web_system%/domains/%domain%.log combined; - access_log /var/log/%web_system%/domains/%domain%.bytes bytes; - expires max; - # try_files $uri @fallback; - } - } - - location /phpmyadmin/ { - proxy_pass https://%ip%:%web_ssl_port%; - } - - location ~ /\.ht {return 404;} - location ~ /\.svn/ {return 404;} - location ~ /\.git/ {return 404;} - location ~ /\.hg/ {return 404;} - location ~ /\.bzr/ {return 404;} - - disable_symlinks if_not_owner from=%docroot%; - - include %home%/%user%/conf/web/snginx.%domain_idn%.conf*; -} - diff --git a/install/debian/10/templates/web/nginx/vesta-webmail-phpmyadmin.tpl b/install/debian/10/templates/web/nginx/vesta-webmail-phpmyadmin.tpl deleted file mode 100644 index 851ac0dcc..000000000 --- a/install/debian/10/templates/web/nginx/vesta-webmail-phpmyadmin.tpl +++ /dev/null @@ -1,8 +0,0 @@ -server { - listen %ip%:%proxy_port%; - server_name %domain_idn% %alias_idn%; - location / { - rewrite ^(.*) https://%domain_idn%$1 permanent; - } -include %home%/%user%/conf/web/*nginx.%domain_idn%.conf_letsencrypt; -} diff --git a/install/debian/10/templates/web/nginx/vesta.stpl b/install/debian/10/templates/web/nginx/vesta.stpl deleted file mode 100644 index 625977340..000000000 --- a/install/debian/10/templates/web/nginx/vesta.stpl +++ /dev/null @@ -1,32 +0,0 @@ -server { - listen %ip%:%proxy_ssl_port% ssl http2; - server_name %domain_idn% %alias_idn%; - # ssl on; - ssl_certificate %ssl_pem%; - ssl_certificate_key %ssl_key%; - error_log /var/log/%web_system%/domains/%domain%.error.log error; - access_log /var/log/%web_system%/domains/%domain%.log combined; - - location / { - proxy_pass https://%ip%:8083; - } - - location /webmail/ { - proxy_pass https://%ip%:%web_ssl_port%; - } - - location /phpmyadmin/ { - proxy_pass https://%ip%:%web_ssl_port%; - } - - location ~ /\.ht {return 404;} - location ~ /\.svn/ {return 404;} - location ~ /\.git/ {return 404;} - location ~ /\.hg/ {return 404;} - location ~ /\.bzr/ {return 404;} - - disable_symlinks if_not_owner from=%docroot%; - - include %home%/%user%/conf/web/snginx.%domain_idn%.conf*; -} - diff --git a/install/debian/10/templates/web/nginx/vesta.tpl b/install/debian/10/templates/web/nginx/vesta.tpl deleted file mode 100644 index 851ac0dcc..000000000 --- a/install/debian/10/templates/web/nginx/vesta.tpl +++ /dev/null @@ -1,8 +0,0 @@ -server { - listen %ip%:%proxy_port%; - server_name %domain_idn% %alias_idn%; - location / { - rewrite ^(.*) https://%domain_idn%$1 permanent; - } -include %home%/%user%/conf/web/*nginx.%domain_idn%.conf_letsencrypt; -}