1
0
mirror of https://github.com/myvesta/vesta.git synced 2025-03-12 04:35:23 -07:00

nginx caching tpl

This commit is contained in:
dpeca 2020-05-24 22:14:13 +02:00
parent 149109698a
commit 9cb73b19df
27 changed files with 103 additions and 0 deletions

@ -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

@ -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*;
}

@ -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*;
}

0
install/debian/7/templates/web/nginx/caching.stpl Executable file → Normal file

0
install/debian/7/templates/web/nginx/caching.tpl Executable file → Normal file

0
install/debian/7/templates/web/nginx/default.stpl Executable file → Normal file

0
install/debian/7/templates/web/nginx/default.tpl Executable file → Normal file

0
install/debian/7/templates/web/nginx/hosting.stpl Executable file → Normal file

0
install/debian/7/templates/web/nginx/hosting.tpl Executable file → Normal file

0
install/debian/7/templates/web/nginx/proxy_ip.tpl Executable file → Normal file

0
install/debian/8/templates/web/nginx/caching.stpl Executable file → Normal file

0
install/debian/8/templates/web/nginx/caching.tpl Executable file → Normal file

0
install/debian/8/templates/web/nginx/default.stpl Executable file → Normal file

0
install/debian/8/templates/web/nginx/default.tpl Executable file → Normal file

0
install/debian/8/templates/web/nginx/hosting.stpl Executable file → Normal file

0
install/debian/8/templates/web/nginx/hosting.tpl Executable file → Normal file

0
install/debian/8/templates/web/nginx/proxy_ip.tpl Executable file → Normal file

0
install/debian/9/templates/web/nginx/caching.stpl Executable file → Normal file

0
install/debian/9/templates/web/nginx/caching.tpl Executable file → Normal file

0
install/debian/9/templates/web/nginx/default.stpl Executable file → Normal file

0
install/debian/9/templates/web/nginx/default.tpl Executable file → Normal file

0
install/debian/9/templates/web/nginx/hosting.stpl Executable file → Normal file

0
install/debian/9/templates/web/nginx/hosting.tpl Executable file → Normal file

0
install/debian/9/templates/web/nginx/proxy_ip.tpl Executable file → Normal file

0
install/vst-install-debian.sh Normal file → Executable file

0
install/vst-install-rhel.sh Executable file → Normal file

0
install/vst-install-ubuntu.sh Executable file → Normal file