diff --git a/install/debian/10/templates/web/nginx/caching.sh b/install/debian/10/templates/web/nginx/caching.sh new file mode 100755 index 00000000..09d8efe7 --- /dev/null +++ b/install/debian/10/templates/web/nginx/caching.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +user=$1 +domain=$2 +ip=$3 +home=$4 +docroot=$5 + +str="proxy_cache_path /var/cache/nginx/$domain levels=2" +str="$str keys_zone=$domain:10m inactive=60m max_size=512m;" +conf='/etc/nginx/conf.d/01_caching_pool.conf' +if [ -e "$conf" ]; then + if [ -z "$(grep "=${domain}:" $conf)" ]; then + echo "$str" >> $conf + fi +else + echo "$str" >> $conf +fi + diff --git a/install/debian/10/templates/web/nginx/caching.stpl b/install/debian/10/templates/web/nginx/caching.stpl new file mode 100644 index 00000000..3c56004d --- /dev/null +++ b/install/debian/10/templates/web/nginx/caching.stpl @@ -0,0 +1,43 @@ +server { + listen %ip%:%proxy_ssl_port% ssl; + server_name %domain_idn% %alias_idn%; + 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%; + + proxy_cache cache; + proxy_cache_valid 15m; + proxy_cache_valid 404 1m; + proxy_no_cache $no_cache; + proxy_cache_bypass $no_cache; + proxy_cache_bypass $cookie_session $http_x_update; + + location ~* ^.+\.(%proxy_extentions%)$ { + proxy_cache off; + 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 /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;} + + include %home%/%user%/conf/web/snginx.%domain%.conf*; +} diff --git a/install/debian/10/templates/web/nginx/caching.tpl b/install/debian/10/templates/web/nginx/caching.tpl new file mode 100644 index 00000000..36761b65 --- /dev/null +++ b/install/debian/10/templates/web/nginx/caching.tpl @@ -0,0 +1,41 @@ +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%; + + proxy_cache cache; + proxy_cache_valid 15m; + proxy_cache_valid 404 1m; + proxy_no_cache $no_cache; + proxy_cache_bypass $no_cache; + proxy_cache_bypass $cookie_session $http_x_update; + + location ~* ^.+\.(%proxy_extentions%)$ { + proxy_cache off; + 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 /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;} + + include %home%/%user%/conf/web/nginx.%domain%.conf*; +} diff --git a/install/debian/7/templates/web/nginx/caching.stpl b/install/debian/7/templates/web/nginx/caching.stpl old mode 100755 new mode 100644 diff --git a/install/debian/7/templates/web/nginx/caching.tpl b/install/debian/7/templates/web/nginx/caching.tpl old mode 100755 new mode 100644 diff --git a/install/debian/7/templates/web/nginx/default.stpl b/install/debian/7/templates/web/nginx/default.stpl old mode 100755 new mode 100644 diff --git a/install/debian/7/templates/web/nginx/default.tpl b/install/debian/7/templates/web/nginx/default.tpl old mode 100755 new mode 100644 diff --git a/install/debian/7/templates/web/nginx/hosting.stpl b/install/debian/7/templates/web/nginx/hosting.stpl old mode 100755 new mode 100644 diff --git a/install/debian/7/templates/web/nginx/hosting.tpl b/install/debian/7/templates/web/nginx/hosting.tpl old mode 100755 new mode 100644 diff --git a/install/debian/7/templates/web/nginx/proxy_ip.tpl b/install/debian/7/templates/web/nginx/proxy_ip.tpl old mode 100755 new mode 100644 diff --git a/install/debian/8/templates/web/nginx/caching.stpl b/install/debian/8/templates/web/nginx/caching.stpl old mode 100755 new mode 100644 diff --git a/install/debian/8/templates/web/nginx/caching.tpl b/install/debian/8/templates/web/nginx/caching.tpl old mode 100755 new mode 100644 diff --git a/install/debian/8/templates/web/nginx/default.stpl b/install/debian/8/templates/web/nginx/default.stpl old mode 100755 new mode 100644 diff --git a/install/debian/8/templates/web/nginx/default.tpl b/install/debian/8/templates/web/nginx/default.tpl old mode 100755 new mode 100644 diff --git a/install/debian/8/templates/web/nginx/hosting.stpl b/install/debian/8/templates/web/nginx/hosting.stpl old mode 100755 new mode 100644 diff --git a/install/debian/8/templates/web/nginx/hosting.tpl b/install/debian/8/templates/web/nginx/hosting.tpl old mode 100755 new mode 100644 diff --git a/install/debian/8/templates/web/nginx/proxy_ip.tpl b/install/debian/8/templates/web/nginx/proxy_ip.tpl old mode 100755 new mode 100644 diff --git a/install/debian/9/templates/web/nginx/caching.stpl b/install/debian/9/templates/web/nginx/caching.stpl old mode 100755 new mode 100644 diff --git a/install/debian/9/templates/web/nginx/caching.tpl b/install/debian/9/templates/web/nginx/caching.tpl old mode 100755 new mode 100644 diff --git a/install/debian/9/templates/web/nginx/default.stpl b/install/debian/9/templates/web/nginx/default.stpl old mode 100755 new mode 100644 diff --git a/install/debian/9/templates/web/nginx/default.tpl b/install/debian/9/templates/web/nginx/default.tpl old mode 100755 new mode 100644 diff --git a/install/debian/9/templates/web/nginx/hosting.stpl b/install/debian/9/templates/web/nginx/hosting.stpl old mode 100755 new mode 100644 diff --git a/install/debian/9/templates/web/nginx/hosting.tpl b/install/debian/9/templates/web/nginx/hosting.tpl old mode 100755 new mode 100644 diff --git a/install/debian/9/templates/web/nginx/proxy_ip.tpl b/install/debian/9/templates/web/nginx/proxy_ip.tpl old mode 100755 new mode 100644 diff --git a/install/vst-install-debian.sh b/install/vst-install-debian.sh old mode 100644 new mode 100755 diff --git a/install/vst-install-rhel.sh b/install/vst-install-rhel.sh old mode 100755 new mode 100644 diff --git a/install/vst-install-ubuntu.sh b/install/vst-install-ubuntu.sh old mode 100755 new mode 100644