Просмотр исходного кода

IPV6: New templates format

Adaptation of default templates for NGINX and APACHE
asmcc 3 лет назад
Родитель
Сommit
4e4f06aef3

+ 1 - 1
install/deb/templates/web/apache2/default.stpl

@@ -4,7 +4,7 @@
 # https://docs.hestiacp.com/admin_docs/web.html#how-do-web-templates-work #
 #=========================================================================#
 
-<VirtualHost %ip%:%web_ssl_port%>
+<VirtualHost%<i4 %web_ipv4%:%web_ssl_port%i4>%%<i6 %web_ipv6%:%web_ssl_port%i6>%>
 
     ServerName %domain_idn%
     %alias_string%

+ 1 - 1
install/deb/templates/web/apache2/default.tpl

@@ -4,7 +4,7 @@
 # https://docs.hestiacp.com/admin_docs/web.html#how-do-web-templates-work #
 #=========================================================================#
 
-<VirtualHost %ip%:%web_port%>
+<VirtualHost%<i4 %web_ipv4%:%web_port%i4>%%<i6 %web_ipv6%:%web_port%i6>%>
 
     ServerName %domain_idn%
     %alias_string%

+ 1 - 1
install/deb/templates/web/apache2/php-fpm/default.stpl

@@ -4,7 +4,7 @@
 # https://docs.hestiacp.com/admin_docs/web.html#how-do-web-templates-work #
 #=========================================================================#
 
-<VirtualHost %ip%:%web_ssl_port%>
+<VirtualHost%<i4 %web_ipv4%:%web_ssl_port%i4>%%<i6 %web_ipv6%:%web_ssl_port%i6>%>
 
     ServerName %domain_idn%
     %alias_string%

+ 1 - 1
install/deb/templates/web/apache2/php-fpm/default.tpl

@@ -4,7 +4,7 @@
 # https://docs.hestiacp.com/admin_docs/web.html#how-do-web-templates-work #
 #=========================================================================#
 
-<VirtualHost %ip%:%web_port%>
+<VirtualHost%<i4 %web_ipv4%:%web_port%i4>%%<i6 %web_ipv6%:%web_port%i6>%>
 
     ServerName %domain_idn%
     %alias_string%

+ 4 - 3
install/deb/templates/web/nginx/default.stpl

@@ -5,7 +5,8 @@
 #=========================================================================#
 
 server {
-    listen      %ip%:%proxy_ssl_port% ssl http2;
+%<i4    listen      %proxy_ipv4%:%proxy_ssl_port% ssl http2;i4>%
+%<i6    listen      %proxy_ipv6%:%proxy_ssl_port% ssl http2;i6>%
     server_name %domain_idn% %alias_idn%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
@@ -16,7 +17,7 @@ server {
     include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
 
     location / {
-        proxy_pass      https://%ip%:%web_ssl_port%;
+        proxy_pass      https://%web_ip%:%web_ssl_port%;
         location ~* ^.+\.(%proxy_extensions%)$ {
             root           %sdocroot%;
             access_log     /var/log/%web_system%/domains/%domain%.log combined;
@@ -31,7 +32,7 @@ server {
     }
 
     location @fallback {
-        proxy_pass      https://%ip%:%web_ssl_port%;
+        proxy_pass      https://%web_ip%:%web_ssl_port%;
     }
 
     location ~ /\.(?!well-known\/|file) {

+ 4 - 3
install/deb/templates/web/nginx/default.tpl

@@ -5,13 +5,14 @@
 #=========================================================================#
 
 server {
-    listen      %ip%:%proxy_port%;
+%<i4    listen      %proxy_ipv4%:%proxy_port%;i4>%
+%<i6    listen      %proxy_ipv6%:%proxy_port%;i6>%
     server_name %domain_idn% %alias_idn%;
 
     include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
 
     location / {
-        proxy_pass      http://%ip%:%web_port%;
+        proxy_pass      http://%web_ip%:%web_port%;
         location ~* ^.+\.(%proxy_extensions%)$ {
             root           %docroot%;
             access_log     /var/log/%web_system%/domains/%domain%.log combined;
@@ -26,7 +27,7 @@ server {
     }
 
     location @fallback {
-        proxy_pass      http://%ip%:%web_port%;
+        proxy_pass      http://%web_ip%:%web_port%;
     }
 
     location ~ /\.(?!well-known\/|file) {

+ 2 - 1
install/deb/templates/web/nginx/php-fpm/default.stpl

@@ -5,7 +5,8 @@
 #=========================================================================#
 
 server {
-    listen      %ip%:%web_ssl_port% ssl http2;
+%<i4    listen      %web_ipv4%:%web_ssl_port% ssl http2;i4>%
+%<i6    listen      %web_ipv6%:%web_ssl_port% ssl http2;i6>%
     server_name %domain_idn% %alias_idn%;
     root        %sdocroot%;
     index       index.php index.html index.htm;

+ 2 - 1
install/deb/templates/web/nginx/php-fpm/default.tpl

@@ -5,7 +5,8 @@
 #=========================================================================#
 
 server {
-    listen      %ip%:%web_port%;
+%<i4    listen      %web_ipv4%:%web_port%;i4>%
+%<i6    listen      %web_ipv6%:%web_port%;i6>%
     server_name %domain_idn% %alias_idn%;
     root        %docroot%;
     index       index.php index.html index.htm;