Народ СРОЧНО!!!!
Добавлено: Сб фев 16, 2019 9:00 am
				
				После обновления панели, на некоторых сайтах на разных хост аккаунтах,не видит .htaccess У кого есть ещё есть такие проблемы?
			Код: Выделить всё
{if $dirconf == '/etc/httpd/vhost.d/' and  $back_server == 'apache2.4'}
{if $front_server == '' && $nat==1}
<VirtualHost {$ip_nat}:{$main_port}>
    {else}
    <VirtualHost {foreach $ip_mas as $key1 => $value}{$value}:{$main_port} {/foreach}>
        {/if}
        {if $bridge_apache == 'mod_ruid'}
            DocumentRoot {$sep_dir}
            RUidGid {$username} {$username}
        {/if}
        ServerName {$domain}
        {if $aliases} ServerAlias {$aliases}  {/if}
        {if $http_redirect == 1 && $ssl == 0 && $back_server == 'apache2.4' && $front_server != 'nginx'}
            Redirect / https://{$domain}
        {/if}
        {if $http_redirect == 2 && $ssl == 1 && $back_server == 'apache2.4' && $front_server != 'nginx'}
            Redirect / http://{$domain}
        {/if}
        DocumentRoot {$dir}
        {if $back_server == 'apache2.4' && $front_server != 'nginx'}
            {if ($http_redirect == 1 && $ssl == 0 ) || ($http_redirect == 2 && $ssl == 1) || $www_redirect|@count >0}
                RewriteEngine On
            {/if}
            {foreach from=$www_redirect item=v}
                {if $v.el == ""}
                    {if $v.type_www == "www"}
                        RewriteCond %{$v.def_http_host} ^www\. [NC]
                        RewriteRule ^(.*)$ {$v.sw}://{$v.dest_full}$1 [R=301,L]
                    {/if}
                    {if $v.type_www == "no_www"}
                        RewriteCond %{$v.def_http_host} ^(?!www) [NC]
                        RewriteRule ^(.*)$ {$v.sw}://{$v.dest_full}$1 [R=301,L]
                    {/if}
                    {if $v.type_www == "both_www"}
                        RewriteRule ^(.*)$ {$v.sw}://{$v.dest_full}$1 [R=301,L]
                    {/if}
                {/if}
            {/foreach}
            {foreach from=$www_redirect item=v}
                {if $v.el != ""}
                    {if $v.type_www == "www"}
                        RewriteCond %{$v.def_http_host} ^www\. [NC]
                        {*RewriteRule /{$v.el} {$v.sw}://{$v.dest_full}$1 [R=301,L]*}
                        RewriteRule /{$v.el} {$v.sw}://{$v.dest_full}$1 [R=301,L]
                    {/if}
                    {if $v.type_www == "no_www"}
                        RewriteCond %{$v.def_http_host} ^(?!www) [NC]
                        {*RewriteRule /{$v.el} {$v.sw}://{$v.dest_full}$1 [R=301,L]*}
                        RewriteRule /{$v.el} {$v.sw}://{$v.dest_full} [R=301,L]
                    {/if}
                    {if $v.type_www == "both_www"}
                        {*Redirect permanent /{$v.el} {$v.sw}://{$v.dest_full}$1*}
                        Redirect permanent /{$v.el} {$v.sw}://{$v.dest_full}
                    {/if}
                {/if}
            {/foreach}
            {if $http_redirect == 1 && $ssl == 0 && $back_server == 'apache2.4' && $front_server != 'nginx'}
                {literal}RewriteCond %{HTTPS} off{/literal}
                {literal}RewriteCond %{HTTP:X-Forwarded-Proto} !https{/literal}
                {literal}RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]{/literal}
            {/if}
            {if $http_redirect == 2 && $ssl == 1 && $back_server == 'apache2.4' && $front_server != 'nginx'}
                Redirect / http://{$domain}
            {/if}
        {/if}
        {if $ssl==1}
            Protocols h2 http/1.1
        {/if}
		 {if $portnginxpanel>0}
		 
		   ProxyPassMatch /webshell/(?<token>.*)/ http://{$ip_nginx}:{$portnginxpanel}/scripts/confirm_auth.php?token=$token
		
			<Location /scripts/confirm_auth.php>
				ProxyPass "http://127.0.0.1:4200/"
				Order      allow,deny
				Allow      from all
			</Location>
			
			
		 {/if}
        {if $main_port == 8080}
            SetEnvIf X-Forwarded-Proto https HTTPS=on
        {/if}
        {if $bridge_apache == 'fastcgi'}
            <IFModule proxy_fcgi_module>
                {if $jailstatsetphp==1}
                {literal}ProxyFCGISetEnvIf "true" SCRIPT_FILENAME "/{/literal}{$sethandlerpath}{literal}%{reqenv:SCRIPT_NAME}"{/literal}
                {/if}
                <FilesMatch \.php$>
                    #SetHandler "proxy:unix:/var/run/php-fpm/{$php}-{$username}.sock|fcgi://{$domain}/{$sethandlerpath}"
                    SetHandler "proxy:unix:/var/run/php-fpm/{$php}-{$username}.sock|fcgi://localhost/"
                </FilesMatch>
            </IFModule>
        {/if}
        {if $back_server == 'apache2.4'}
            {if $AllowOverride==0}
                <Directory "{$rootdirAllowOverride}">
                    AllowOverride None
                </Directory>
            {/if}
            {foreach from=$dir_ps item=v}
                {if $v.subdir != "/"}
                    <Directory "{$v.dir_full}">
                    Options +FollowSymLinks +Multiviews -Indexes
                    AllowOverride None
                    AuthType Basic
                    AuthName "Restricted Area"
                    AuthBasicProvider file
                    AuthUserFile {$v.dir_full}/passwd
                    Require valid-user
                    </Directory>
                {/if}
            {/foreach}
        {/if}
        {if $portnginxpanel|strlen>0}
            SSLProxyEngine on
            SSLProxyVerify none
            ProxyRequests Off
            ProxyPreserveHost Off
            ProxyVia full
            <proxy *>
                Order deny,allow
                Allow from all
            </proxy>
            RequestHeader set X-Forwarded-Proto "https" env=HTTPS
            ProxyPass        /  http://{foreach $ip_mas as $key1 => $value}{$value}{/foreach}:{$portnginxpanel}/
            ProxyPassReverse /  http://{foreach $ip_mas as $key1 => $value}{$value}{/foreach}:{$portnginxpanel}/
        {/if}
        {if $gzipstat==1}
            <IfModule mod_deflate.c>
                AddOutputFilterByType DEFLATE text/css
                AddOutputFilterByType DEFLATE text/plain
                AddOutputFilterByType DEFLATE text/html
                AddOutputFilterByType DEFLATE text/xml
                AddOutputFilterByType DEFLATE application/xml
                AddOutputFilterByType DEFLATE application/rss+xml
                AddOutputFilterByType DEFLATE text/javascript
                AddOutputFilterByType DEFLATE application/javascript
                AddOutputFilterByType DEFLATE application/x-javascript
                BrowserMatch ^Mozilla/4 gzip-only-text/html
                BrowserMatch ^Mozilla/4\.0[678] no-gzip
                BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
            </IfModule>
        {/if}
        {if $cachestat==1}
            <ifModule mod_expires.c>
                ExpiresActive On
                ExpiresDefault "access plus {$cacheextExp} seconds"
            </ifModule>
            <IfModule mod_headers.c>
                {*<filesMatch "ttf,jpg,jpeg,png,ico,css,bmp,swf,js,txt,tar,zip,pdf,tar.gz,woff[2]$">*}
                <filesMatch ".+\.(ttf|jpg|jpeg|png|ico|css|bmp|swf|js|txt|tar|zip|pdf|tar\.gz|woff[2]?)$">
                Header set Cache-Control "max-age={$cacheextExp}"
                </filesMatch>
            </IfModule>
        {/if}
        {if $pass_root_domain == 0}
            <Directory "{$dir}">
            AllowOverride All
            Require all granted
            </Directory>
        {/if}
        {if $ssl==0}
            {$letencrypt0}
            {$letencrypt1}
            {$letencrypt2}
            {$letencrypt3}
            {$letencrypt4}
            {$letencrypt5}
            {$letencrypt6}
        {/if}
        {if $logaccess==1}
            CustomLog {$access_log} combined
        {/if}
        {if $logerror==1}
            ErrorLog {$error_log}
        {/if}
        DirectoryIndex index.php index.html index.htm
        {if $bridge_apache == 'suphp'}
            suPHP_Engine on
            AddHandler x-httpd-php{$php} .php
            suPHP_AddHandler x-httpd-php{$php}
        {/if}
        {if $bridge_apache == 'mod_php' ||  $bridge_apache == 'mod_ruid'}
            <ifModule php7_module>
                AddHandler php7-script .php
            </ifModule>
            <ifModule php5_module>
                AddHandler php5-script .php
            </ifModule>
            #AddHandler {$phpx_script} .php
            AddType text/html .php
        {/if}
        {if $bridge_apache == 'cgi'}
            <Directory "{$php_bin}">
            Require all granted
            </Directory>
            ScriptAlias /cgi-bin/ "{$dir}/cgi-bin/"
            Options Indexes FollowSymLinks ExecCGI
            AddHandler php5-cgi .php
            Action php5-cgi /cgi-bin/php.cgi
            SuexecUserGroup {$username} {$username}
        {/if}
        {if $ssl== 1}
            {if $key|@filesize>0 && $crt|@filesize>0}
                SSLEngine On
                {if $back_server == 'apache2.2'}
                    SSLCertificateFile {$crt}
                {/if}
                {if $back_server == 'apache2.4'}
                    {if "{$crt}_v2"|@filesize>0}
                        SSLCertificateFile {$crt}_v2
                    {else}
                        SSLCertificateFile {$crt}
                    {/if}
                {/if}
                SSLCertificateKeyFile {$key}
            {/if}
            {if $back_server == 'apache2.2'}
                {if $chein}
                    SSLCertificateChainFile {$chein}
                {/if}
            {/if}
            {if $ssl_options|strlen>1}Include {$ssl_options}{/if}
        {/if}
        {if $suspended_sites==1}
            {if (($back_server != 'nginx') && ($front_server != 'nginx'))}
                {if  (($bridge_apache != 'nophp') && ($php != "nophpw"))}
                    <Directory "{$dir}">
                    AllowOverride none
                    RewriteEngine On
                    RewriteCond {literal}%{REQUEST_URI} !suspended.php${/literal}
                    RewriteRule {literal}$ /suspended.php [R=302]{/literal}
                    </Directory>
                {else}
                    <Directory "{$dir}">
                    AllowOverride none
                    RewriteEngine On
                    RewriteCond {literal}%{REQUEST_URI} !suspended.html${/literal}
                    RewriteRule {literal}$ /suspended.html [R=302]{/literal}
                    </Directory>
                {/if}
            {/if}
        {/if}
        {if $domain!='default'}
            {if $patf_apache_access|@filesize>0 && $ssl==0}
                Include {$patf_apache_access}
            {/if}
            {assign var=aassl value=$patf_apache_access|cat:'.ssl'}
            {if $aassl|@filesize>0 && $ssl==1}
                Include {$aassl}
            {/if}
        {/if}
        {if $modsecglobal!=0}
            {if $modsec_stat==0}
                <IfModule mod_security2.c>
                    SecRuleEngine Off
                </IfModule>
            {/if}
        {/if}
		
		{foreach $error_code as $key_error_code=>$val_error_code}
			{if $val_error_code}
				ErrorDocument  {$key_error_code}    {$val_error_code}
			{/if}
		{/foreach}
    </VirtualHost>
    {/if}
    {if $dirconf == '/etc/nginx/sites-available/'}
        server {
        {if $domain=='default'}
            {if $ssl==1}
                {if $nat==1}
                    listen  {$ip_nat}:443;
                {else}
                    listen  {foreach $ip_mas as $key1 => $value}{$value}:443 {/foreach};
                {/if}
            {else}
                {if $nat==1}
                    listen  {$ip_nat}:80;
                {else}
                    listen  {foreach $ip_mas as $key1 => $value}{$value}:80{/foreach};
                {/if}
            {/if}
        {else}
            {if (($front_server == 'nginx' && $nat==1) || ($back_server == 'nginx' && $nat==1))}
                {if $ssl==1}
                    listen  {$ip_nat}:{$main_port} ssl http2;
                {else}
                    listen  {$ip_nat}:{$main_port};
                {/if}
            {else}
                {if $ssl==1}
                    listen  {foreach $ip_mas as $key1 => $value}{$value}:{$main_port} ssl http2{/foreach};
                {else}
                    listen  {foreach $ip_mas as $key1 => $value}{$value}:{$main_port} {/foreach};
                {/if}
            {/if}
        {/if}
        server_name  {$domain} {$aliases};
        root  {$dir};
        {if $ssl==1}
            ssl on;
            {if $domain=='default'}
                {if "{$crt}_v2"|@filesize>0}
                    ssl_certificate {$crt}_v2;
                {else}
                    ssl_certificate  {$crt};
                {/if}
            {/if}
            {if $domain!='default'}
                {if "{$crt}_v2"|@filesize>0}
                    ssl_certificate {$crt}_v2;
                {else}
                    ssl_certificate  {$crt};
                {/if}
            {/if}
            ssl_certificate_key {$key};
            ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
            ssl_ciphers  "HIGH:!RC4:!aNULL:!MD5:!kEDH";
            {if $http_redirect == 2}
                add_header Strict-Transport-Security 'max-age=0';
            {else}
                add_header Strict-Transport-Security 'max-age=604800';
            {/if}
        {/if}
        {if $logaccess==1}
            access_log {$access_log};
        {/if}
        {if $logerror==1}
            error_log {$error_log};
        {/if}
        {if $back_server == 'nginx' || $front_server == 'nginx'}
            {foreach from=$www_redirect item=v}
					
					{if $v.type_www=='both_www'}
						if ($http_host ~ ^(www\.)?{$v.domain}) {literal}{{/literal}
					{/if}					
					{if $v.type_www=='no_www'}
						if ($http_host ~ ^{$v.domain}) {literal}{{/literal}
					{/if}
					{if $v.type_www=='www'}
						if ($http_host ~ ^(www\.)+{$v.domain}) {literal}{{/literal}
					{/if}	
						{if $v.el != ""}					
								rewrite /{$v.el} http://{$v.dest_full} permanent;
						{else}		
								rewrite ^.*$ http://{$v.dest_full} permanent;								
						{/if}
						{literal}}{/literal}	
										
					
            {/foreach}
        {/if}
        {if $http_redirect == 1 && $ssl == 0}
            rewrite ^(.*) https://$http_host$request_uri permanent;
        {/if}
        {if $http_redirect == 2 && $ssl == 1}
            rewrite ^(.*) http://$http_host$request_uri permanent;
        {/if}
        {if $back_server == 'nginx'}
            {foreach from=$dir_ps item=v}
                {if $v.dir_subdir != "/"}
                    location {$v.dir_subdir} {
                    auth_basic 'Unauthorized';
                    auth_basic_user_file {$v.dir_full}/passwd;
                    }
                {/if}
            {/foreach}
        {/if}
        {if $dir_ps|@count >0}
            location ~ /passwd {
            deny all;
            access_log off;
            log_not_found off;
            }
        {/if}
        {if $patf_nginx_access|@filesize && $ssl==0}
            include {$patf_nginx_access};
        {/if}
        {assign var=aassl value=$patf_nginx_access|cat:'.ssl'}
        {if $aassl|@filesize && $ssl==1}
            include {$aassl};
        {/if}
        location ~ /.well-known { allow all; }
        # location ~* robots.txt  { root /etc/nginx; }
        location ~ /\.ht {
        deny all;
        access_log off;
        log_not_found off;
        }
        {if $gzipstat==1}
            gzip on;
            gzip_disable "MSIE [1-6]\.(?!.*SV1)";
            gzip_comp_level 3;
            gzip_types text/plain text/css application/json application/x-javascript text/html text/xml application/xml application/xml+rss text/javascript application/javascript;
        {/if}
        {if $cachestat==1}
        {literal}location ~* ^.+\.({/literal}{$cacheext}{literal})$ {{/literal}
            root {$dir};
            expires {$cacheextExp}s;
            proxy_set_header Host $host;
            }
        {/if}
        {if $web_server || $portnginxpanel|strlen>0}
		
            {if $portnginxpanel>0}
					 location ~ /webshell/(?<token>.*)/ {
						auth_request @auth;	
						proxy_set_header X-Real-IP $remote_addr;
						proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
						proxy_pass  http://127.0.0.1:4200;
						proxy_read_timeout 90;
						proxy_redirect     off;
					}		
							
					location = @auth {
						internal;
						proxy_pass_header Authorization;
						proxy_pass  http://{$ip_nginx}:{$portnginxpanel}/scripts/confirm_auth.php?token=$token;
						proxy_read_timeout 90;
						proxy_pass_request_body off;
						proxy_set_header        Content-Length "";
						proxy_set_header        X-Original-URI $request_uri;
						proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
						proxy_set_header X-Real-IP $remote_addr;
					}	         
			{/if}		
		
		
            location / {
            {if $back_server == 'nginx'}
                {if $pass_root_domain==1}
                    {foreach from=$dir_ps item=v}
                        {if $v.dir_subdir == "/"}
                            auth_basic 'Unauthorized';
                            auth_basic_user_file {$v.dir_full}passwd;
                        {/if}
                    {/foreach}
                {/if}
            {/if}
            root {$dir};
            {if $portnginxpanel|strlen>0}
                proxy_ssl_verify off;
                proxy_pass http://{$ip_nginx}:{$portnginxpanel};
            {else}
                proxy_pass http://{$ip_nginx}:8080;
            {/if}
            proxy_redirect     off;
            proxy_force_ranges on;
            proxy_set_header   Host $host;
            proxy_set_header   X-Real-IP $remote_addr;
            proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
            {if $ssl== 1}
                proxy_set_header   X-Forwarded-Proto $scheme;
                proxy_set_header   HTTPS $scheme;
            {/if}
    	    {if $nginxstat==1}
            proxy_cache off;
	    {else}
            proxy_cache one;
	    {/if}
            proxy_cache_key "$request_method|$http_if_modified_since|$http_if_none_match|$host|$request_uri";
            #access_log /etc/nginx/vhost_logs/{$dir};
            proxy_cache_valid 3s;
            proxy_cache_min_uses 2;
            # proxy_cache_lock on;
            # proxy_cache_use_stale error timeout;
            # proxy_cache_use_stale updating http_502 http_504;
            limit_conn lone 50;
            # limit_req zone=ltwo burst=10;
            client_max_body_size       24m;
            client_body_buffer_size    128k;
            proxy_connect_timeout      90;
            proxy_send_timeout         90;
            proxy_read_timeout         90;
            proxy_buffer_size          4k;
            proxy_buffers              8 32k;
            proxy_busy_buffers_size    64k;
            proxy_temp_file_write_size 10m;
            {if $modsecglobal!=0}
                {if $modsec_stat==0}
                    ModSecurityEnabled off;
                {/if}
                {if $modsec_stat==1}
                    ModSecurityEnabled on;
                {/if}
            {/if}
            }
        {else}
            location / {
            {$http_to_https}
            root {$dir};
            {if $back_server == 'nginx'}
                {if $pass_root_domain==1}
                    {foreach from=$dir_ps item=v}
                        {if $v.dir_subdir == "/"}
                            auth_basic 'Unauthorized';
                            auth_basic_user_file {$v.dir_full}passwd;
                        {/if}
                    {/foreach}
                {/if}
            {/if}
            {if $patf_nginx_access_loct|@filesize}
                {assign var=aa value=$patf_nginx_access_loct|cat:'.ssl'}
                include {$patf_nginx_access_loct}{if $ssl==1  && ($aa|@filesize)}.ssl{/if};
            {else}
                index index.php index.html index.htm;
										  
				{if $error_code[404]}
					#if (!-e $request_filename) {
					#rewrite ^(.+)$ /index.php?q=$1 last;
					#}				
				{else}
					if (!-e $request_filename) {
					rewrite ^(.+)$ /index.php?q=$1 last;
					}
				{/if}
            {/if}
            {if $modsecglobal!=0}
                {if $modsec_stat==0}
                    ModSecurityEnabled off;
                {/if}
                {if $modsec_stat==1}
                    ModSecurityEnabled on;
                {/if}
            {/if}
            }
        {/if}
        {if $bridge_nginx == 'fpm' and $back_server != 'apache2.2' and $back_server != 'apache2.4'}
            location ~ \.php$ {
	    try_files $fastcgi_script_name =404;
            root                       {$dir};
            #fastcgi_pass       localhost:{$port};
            fastcgi_pass unix:/var/run/php-fpm/{$php}-{$username}.sock;
            include fastcgi_params;
            fastcgi_split_path_info                 ^(.+?\.php)(/.*)?$;
            fastcgi_index index.php;
            fastcgi_param   SCRIPT_FILENAME         {$dir}$fastcgi_script_name;
            fastcgi_param   PATH_TRANSLATED         {$dir}$fastcgi_script_name;
            fastcgi_buffers 8 64k;
            fastcgi_buffer_size 128k;
            fastcgi_busy_buffers_size 128k;
            fastcgi_connect_timeout 120;
            fastcgi_read_timeout 900;
            fastcgi_send_timeout 900;
    	    {if $nginxstat==1}
            fastcgi_cache off;
	    {else}
            fastcgi_cache fcgi;
	    {/if}
            fastcgi_cache_key "$request_method|$http_if_modified_since|$http_if_none_match|$host|$request_uri";
            fastcgi_cache_valid 200 10s;
            limit_conn lfcgi 50;
            #fastcgi_param   SCRIPT_FILENAME         /{$sethandlerpath}$fastcgi_script_name;
            #fastcgi_param   PATH_TRANSLATED         /{$sethandlerpath}$fastcgi_script_name;
            set             $path_info              $fastcgi_path_info;
            fastcgi_param   PATH_INFO               $path_info;
            {if $modsecglobal!=0}
                {if $modsec_stat==0}
                    ModSecurityEnabled off;
                {/if}
                {if $modsec_stat==1}
                    ModSecurityEnabled on;
                {/if}
            {/if}
            }
        {/if}
        {if $suspended_sites==1}
            {if (($bridge_nginx != 'nophp')&& ($php != "nophpw"))}
                if ($request_uri != /suspended.php) {
                rewrite ^ "http://{$domain}/suspended.php" permanent;#301 redirect
                }
            {else}
                if ($request_uri != /suspended.html) {
                rewrite ^ "http://{$domain}/suspended.html" permanent;#301 redirect
                }
            {/if}
        {/if}
		
		
		{foreach $error_code as $key_error_code=>$val_error_code}
			{if $val_error_code}
				error_page  {$key_error_code}    {$val_error_code};
			{/if}
		{/foreach}
        # error_page  404              /404.html;
        # location = /40x.html {
        # }
        # error_page   500 502 503 504  /50x.html;
        # location = /50x.html {
        # }
        }
    {/if}

было тоже самое, спасибо
уже давно прошу у разрабов эту фичу, чтобы можно было для каждого сайта выбирать нужен ему апач или нет, но все никак

та не, зачем контениризация, то сложно слишком. пусть апач запущен будет, просто для сайта выбор использовать его или нет, а это решается просто конфигами сайтов. я это и сейчас сделать могу, просто руками, а с учетом того что панель при каждом обновлении заново пересобирает конфиги сайтов - это нереально
 
 