Преглед изворни кода

Merge branch 'master' into fix-tar-exclude-folder

Dmitry Bannik пре 7 година
родитељ
комит
eb29a1f374
100 измењених фајлова са 1677 додато и 2062 уклоњено
  1. 5 3
      bin/v-add-backup-host
  2. 11 11
      bin/v-add-user-package
  3. 5 2
      bin/v-add-web-domain
  4. 22 11
      bin/v-backup-user
  5. 3 0
      bin/v-backup-users
  6. 18 7
      bin/v-list-users
  7. 1 0
      bin/v-list-web-domain-ssl
  8. 5 0
      bin/v-open-fs-config
  9. 5 1
      bin/v-update-letsencrypt-ssl
  10. 3 0
      bin/v-update-user-stats
  11. 14 3
      func/main.sh
  12. 1 0
      install/debian/7/nginx/nginx.conf
  13. 1 1
      install/debian/7/sudo/admin
  14. 23 29
      install/debian/7/templates/web/nginx/php5-fpm/drupal6.stpl
  15. 21 28
      install/debian/7/templates/web/nginx/php5-fpm/drupal6.tpl
  16. 25 31
      install/debian/7/templates/web/nginx/php5-fpm/drupal7.stpl
  17. 24 31
      install/debian/7/templates/web/nginx/php5-fpm/drupal7.tpl
  18. 25 32
      install/debian/7/templates/web/nginx/php5-fpm/drupal8.stpl
  19. 24 32
      install/debian/7/templates/web/nginx/php5-fpm/drupal8.tpl
  20. 1 0
      install/debian/8/nginx/nginx.conf
  21. 1 1
      install/debian/8/sudo/admin
  22. 23 29
      install/debian/8/templates/web/nginx/php5-fpm/drupal6.stpl
  23. 21 28
      install/debian/8/templates/web/nginx/php5-fpm/drupal6.tpl
  24. 25 31
      install/debian/8/templates/web/nginx/php5-fpm/drupal7.stpl
  25. 24 31
      install/debian/8/templates/web/nginx/php5-fpm/drupal7.tpl
  26. 25 32
      install/debian/8/templates/web/nginx/php5-fpm/drupal8.stpl
  27. 24 32
      install/debian/8/templates/web/nginx/php5-fpm/drupal8.tpl
  28. 1 0
      install/debian/9/nginx/nginx.conf
  29. 1 1
      install/debian/9/sudo/admin
  30. 23 29
      install/debian/9/templates/web/nginx/php-fpm/drupal6.stpl
  31. 21 28
      install/debian/9/templates/web/nginx/php-fpm/drupal6.tpl
  32. 25 31
      install/debian/9/templates/web/nginx/php-fpm/drupal7.stpl
  33. 24 31
      install/debian/9/templates/web/nginx/php-fpm/drupal7.tpl
  34. 25 32
      install/debian/9/templates/web/nginx/php-fpm/drupal8.stpl
  35. 24 32
      install/debian/9/templates/web/nginx/php-fpm/drupal8.tpl
  36. 1 0
      install/rhel/5/nginx/nginx.conf
  37. 1 1
      install/rhel/5/sudo/admin
  38. 23 29
      install/rhel/5/templates/web/nginx/php-fpm/drupal6.stpl
  39. 21 28
      install/rhel/5/templates/web/nginx/php-fpm/drupal6.tpl
  40. 25 31
      install/rhel/5/templates/web/nginx/php-fpm/drupal7.stpl
  41. 24 31
      install/rhel/5/templates/web/nginx/php-fpm/drupal7.tpl
  42. 25 32
      install/rhel/5/templates/web/nginx/php-fpm/drupal8.stpl
  43. 24 32
      install/rhel/5/templates/web/nginx/php-fpm/drupal8.tpl
  44. 1 0
      install/rhel/6/nginx/nginx.conf
  45. 1 1
      install/rhel/6/sudo/admin
  46. 23 29
      install/rhel/6/templates/web/nginx/php-fpm/drupal6.stpl
  47. 21 28
      install/rhel/6/templates/web/nginx/php-fpm/drupal6.tpl
  48. 25 31
      install/rhel/6/templates/web/nginx/php-fpm/drupal7.stpl
  49. 24 31
      install/rhel/6/templates/web/nginx/php-fpm/drupal7.tpl
  50. 25 32
      install/rhel/6/templates/web/nginx/php-fpm/drupal8.stpl
  51. 24 32
      install/rhel/6/templates/web/nginx/php-fpm/drupal8.tpl
  52. 1 0
      install/rhel/7/nginx/nginx.conf
  53. 1 1
      install/rhel/7/sudo/admin
  54. 23 29
      install/rhel/7/templates/web/nginx/php-fpm/drupal6.stpl
  55. 21 28
      install/rhel/7/templates/web/nginx/php-fpm/drupal6.tpl
  56. 25 31
      install/rhel/7/templates/web/nginx/php-fpm/drupal7.stpl
  57. 24 31
      install/rhel/7/templates/web/nginx/php-fpm/drupal7.tpl
  58. 25 32
      install/rhel/7/templates/web/nginx/php-fpm/drupal8.stpl
  59. 24 32
      install/rhel/7/templates/web/nginx/php-fpm/drupal8.tpl
  60. 1 0
      install/ubuntu/12.04/nginx/nginx.conf
  61. 1 1
      install/ubuntu/12.04/sudo/admin
  62. 23 29
      install/ubuntu/12.04/templates/web/nginx/php-fpm/drupal6.stpl
  63. 21 28
      install/ubuntu/12.04/templates/web/nginx/php-fpm/drupal6.tpl
  64. 25 31
      install/ubuntu/12.04/templates/web/nginx/php-fpm/drupal7.stpl
  65. 24 31
      install/ubuntu/12.04/templates/web/nginx/php-fpm/drupal7.tpl
  66. 25 32
      install/ubuntu/12.04/templates/web/nginx/php-fpm/drupal8.stpl
  67. 24 32
      install/ubuntu/12.04/templates/web/nginx/php-fpm/drupal8.tpl
  68. 1 0
      install/ubuntu/12.10/nginx/nginx.conf
  69. 1 1
      install/ubuntu/12.10/sudo/admin
  70. 23 29
      install/ubuntu/12.10/templates/web/nginx/php-fpm/drupal6.stpl
  71. 21 28
      install/ubuntu/12.10/templates/web/nginx/php-fpm/drupal6.tpl
  72. 25 31
      install/ubuntu/12.10/templates/web/nginx/php-fpm/drupal7.stpl
  73. 24 31
      install/ubuntu/12.10/templates/web/nginx/php-fpm/drupal7.tpl
  74. 25 32
      install/ubuntu/12.10/templates/web/nginx/php-fpm/drupal8.stpl
  75. 24 32
      install/ubuntu/12.10/templates/web/nginx/php-fpm/drupal8.tpl
  76. 1 0
      install/ubuntu/13.04/nginx/nginx.conf
  77. 1 1
      install/ubuntu/13.04/sudo/admin
  78. 23 29
      install/ubuntu/13.04/templates/web/nginx/php-fpm/drupal6.stpl
  79. 21 28
      install/ubuntu/13.04/templates/web/nginx/php-fpm/drupal6.tpl
  80. 25 31
      install/ubuntu/13.04/templates/web/nginx/php-fpm/drupal7.stpl
  81. 24 31
      install/ubuntu/13.04/templates/web/nginx/php-fpm/drupal7.tpl
  82. 25 32
      install/ubuntu/13.04/templates/web/nginx/php-fpm/drupal8.stpl
  83. 24 32
      install/ubuntu/13.04/templates/web/nginx/php-fpm/drupal8.tpl
  84. 1 0
      install/ubuntu/13.10/nginx/nginx.conf
  85. 1 1
      install/ubuntu/13.10/sudo/admin
  86. 23 29
      install/ubuntu/13.10/templates/web/nginx/php-fpm/drupal6.stpl
  87. 21 28
      install/ubuntu/13.10/templates/web/nginx/php-fpm/drupal6.tpl
  88. 25 31
      install/ubuntu/13.10/templates/web/nginx/php-fpm/drupal7.stpl
  89. 24 31
      install/ubuntu/13.10/templates/web/nginx/php-fpm/drupal7.tpl
  90. 25 32
      install/ubuntu/13.10/templates/web/nginx/php-fpm/drupal8.stpl
  91. 24 32
      install/ubuntu/13.10/templates/web/nginx/php-fpm/drupal8.tpl
  92. 1 0
      install/ubuntu/14.04/nginx/nginx.conf
  93. 1 1
      install/ubuntu/14.04/sudo/admin
  94. 23 29
      install/ubuntu/14.04/templates/web/nginx/php-fpm/drupal6.stpl
  95. 21 28
      install/ubuntu/14.04/templates/web/nginx/php-fpm/drupal6.tpl
  96. 25 31
      install/ubuntu/14.04/templates/web/nginx/php-fpm/drupal7.stpl
  97. 24 31
      install/ubuntu/14.04/templates/web/nginx/php-fpm/drupal7.tpl
  98. 25 32
      install/ubuntu/14.04/templates/web/nginx/php-fpm/drupal8.stpl
  99. 24 32
      install/ubuntu/14.04/templates/web/nginx/php-fpm/drupal8.tpl
  100. 1 0
      install/ubuntu/14.10/nginx/nginx.conf

+ 5 - 3
bin/v-add-backup-host

@@ -38,8 +38,8 @@ EOF
 sftpc() {
 sftpc() {
     expect -f "-" <<EOF "$@"
     expect -f "-" <<EOF "$@"
         set count 0
         set count 0
-        spawn /usr/bin/sftp -o StrictHostKeyChecking=no -o \
-            Port=$port $user@$host
+        spawn "/usr/bin/sftp -o StrictHostKeyChecking=no -o \
+            Port=$port '$user@$host'"
         expect {
         expect {
             "password:" {
             "password:" {
                 send "$password\r"
                 send "$password\r"
@@ -94,12 +94,14 @@ EOF
 
 
 if [ "$type" != 'local' ];then
 if [ "$type" != 'local' ];then
     check_args '4' "$#" "TYPE HOST USERNAME PASSWORD [PATH] [PORT]"
     check_args '4' "$#" "TYPE HOST USERNAME PASSWORD [PATH] [PORT]"
-    is_format_valid 'host'
+    is_format_valid 'user' 'host' 'path' 'port'
     is_password_valid
     is_password_valid
     if [ "$type" = 'sftp' ]; then
     if [ "$type" = 'sftp' ]; then
         which expect >/dev/null 2>&1
         which expect >/dev/null 2>&1
         check_result $? "expect command not found"  $E_NOTEXIST
         check_result $? "expect command not found"  $E_NOTEXIST
     fi
     fi
+    host "$host" >/dev/null 2>&1
+    check_result $? "host connection failed" "$E_CONNECT"
 fi
 fi
 
 
 
 

+ 11 - 11
bin/v-add-user-package

@@ -30,37 +30,37 @@ is_package_new() {
 is_package_consistent() {
 is_package_consistent() {
     source $pkg_dir/$package.pkg
     source $pkg_dir/$package.pkg
     if [ "$WEB_DOMAINS" != 'unlimited' ]; then
     if [ "$WEB_DOMAINS" != 'unlimited' ]; then
-        is_format_valid_int $WEB_DOMAINS 'WEB_DOMAINS'
+        is_int_format_valid $WEB_DOMAINS 'WEB_DOMAINS'
     fi
     fi
     if [ "$WEB_ALIASES" != 'unlimited' ]; then
     if [ "$WEB_ALIASES" != 'unlimited' ]; then
-        is_format_valid_int $WEB_ALIASES 'WEB_ALIASES'
+        is_int_format_valid $WEB_ALIASES 'WEB_ALIASES'
     fi
     fi
     if [ "$DNS_DOMAINS" != 'unlimited' ]; then
     if [ "$DNS_DOMAINS" != 'unlimited' ]; then
-        is_format_valid_int $DNS_DOMAINS 'DNS_DOMAINS'
+        is_int_format_valid $DNS_DOMAINS 'DNS_DOMAINS'
     fi
     fi
     if [ "$DNS_RECORDS" != 'unlimited' ]; then
     if [ "$DNS_RECORDS" != 'unlimited' ]; then
-        is_format_valid_int $DNS_RECORDS 'DNS_RECORDS'
+        is_int_format_valid $DNS_RECORDS 'DNS_RECORDS'
     fi
     fi
     if [ "$MAIL_DOMAINS" != 'unlimited' ]; then
     if [ "$MAIL_DOMAINS" != 'unlimited' ]; then
-        is_format_valid_int $MAIL_DOMAINS 'MAIL_DOMAINS'
+        is_int_format_valid $MAIL_DOMAINS 'MAIL_DOMAINS'
     fi
     fi
     if [ "$MAIL_ACCOUNTS" != 'unlimited' ]; then
     if [ "$MAIL_ACCOUNTS" != 'unlimited' ]; then
-        is_format_valid_int $MAIL_ACCOUNTS 'MAIL_ACCOUNTS'
+        is_int_format_valid $MAIL_ACCOUNTS 'MAIL_ACCOUNTS'
     fi
     fi
     if [ "$DATABASES" != 'unlimited' ]; then
     if [ "$DATABASES" != 'unlimited' ]; then
-        is_format_valid_int $DATABASES 'DATABASES'
+        is_int_format_valid $DATABASES 'DATABASES'
     fi
     fi
     if [ "$CRON_JOBS" != 'unlimited' ]; then
     if [ "$CRON_JOBS" != 'unlimited' ]; then
-        is_format_valid_int $CRON_JOBS 'CRON_JOBS'
+        is_int_format_valid $CRON_JOBS 'CRON_JOBS'
     fi
     fi
     if [ "$DISK_QUOTA" != 'unlimited' ]; then
     if [ "$DISK_QUOTA" != 'unlimited' ]; then
-        is_format_valid_int $DISK_QUOTA 'DISK_QUOTA'
+        is_int_format_valid $DISK_QUOTA 'DISK_QUOTA'
     fi
     fi
     if [ "$BANDWIDTH" != 'unlimited' ]; then
     if [ "$BANDWIDTH" != 'unlimited' ]; then
-        is_format_valid_int $BANDWIDTH 'BANDWIDTH'
+        is_int_format_valid $BANDWIDTH 'BANDWIDTH'
     fi
     fi
     if [ "$BACKUPS" != 'unlimited' ]; then
     if [ "$BACKUPS" != 'unlimited' ]; then
-        is_format_valid_int $BACKUPS 'BACKUPS'
+        is_int_format_valid $BACKUPS 'BACKUPS'
     fi
     fi
     is_format_valid_shell $SHELL
     is_format_valid_shell $SHELL
 }
 }

+ 5 - 2
bin/v-add-web-domain

@@ -113,9 +113,12 @@ if [ "$aliases" = 'none' ]; then
     ALIAS=''
     ALIAS=''
 else
 else
     ALIAS="www.$domain"
     ALIAS="www.$domain"
-    if [ ! -z "$aliases" ]; then
-        ALIAS="$ALIAS,$aliases"
+    if [ -z "$aliases" ]; then
+        ALIAS="www.$domain"
+    else
+        ALIAS="$aliases"
     fi
     fi
+    
     ip_alias=$(get_ip_alias $domain)
     ip_alias=$(get_ip_alias $domain)
     if [ ! -z "$ip_alias" ]; then
     if [ ! -z "$ip_alias" ]; then
         ALIAS="$ALIAS,$ip_alias"
         ALIAS="$ALIAS,$ip_alias"

+ 22 - 11
bin/v-backup-user

@@ -216,6 +216,9 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
             cp $USER_DATA/ssl/$domain.* vesta/
             cp $USER_DATA/ssl/$domain.* vesta/
         fi
         fi
 
 
+        # Changin dir to documentroot
+        cd $HOMEDIR/$user/web/$domain
+
         # Define exclude arguments
         # Define exclude arguments
         exlusion=$(echo -e "$WEB" |tr ',' '\n' |grep "^$domain:")
         exlusion=$(echo -e "$WEB" |tr ',' '\n' |grep "^$domain:")
         set -f
         set -f
@@ -224,15 +227,20 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
         if [ ! -z "$exlusion" ]; then
         if [ ! -z "$exlusion" ]; then
             xdirs="$(echo -e "$exlusion" |tr ':' '\n' |grep -v $domain)"
             xdirs="$(echo -e "$exlusion" |tr ':' '\n' |grep -v $domain)"
             for xpath in $xdirs; do
             for xpath in $xdirs; do
-                fargs+=(--exclude=$xpath/*)
-                echo "$(date "+%F %T") excluding directory $xpath"
-                msg="$msg\n$(date "+%F %T") excluding directory $xpath"
+                if [ -d "$xpath" ]; then
+                    fargs+=(--exclude=$xpath/*)
+                    echo "$(date "+%F %T") excluding directory $xpath"
+                    msg="$msg\n$(date "+%F %T") excluding directory $xpath"
+                else
+                    echo "$(date "+%F %T") excluding file $xpath"
+                    msg="$msg\n$(date "+%F %T") excluding file $xpath"
+                    fargs+=(--exclude=$xpath)
+                fi
             done
             done
         fi
         fi
         set +f
         set +f
 
 
         # Backup files
         # Backup files
-        cd $HOMEDIR/$user/web/$domain
         tar -cpf- ${fargs[@]} * |gzip -$BACKUP_GZIP - > $tmpdir/web/$domain/domain_data.tar.gz
         tar -cpf- ${fargs[@]} * |gzip -$BACKUP_GZIP - > $tmpdir/web/$domain/domain_data.tar.gz
     done
     done
 
 
@@ -392,14 +400,17 @@ if [ ! -z "$DB_SYSTEM" ] && [ "$DB" != '*' ]; then
         grep "DB='$database'" $conf > vesta/db.conf
         grep "DB='$database'" $conf > vesta/db.conf
 
 
         dump="$tmpdir/db/$database/$database.$TYPE.sql"
         dump="$tmpdir/db/$database/$database.$TYPE.sql"
+        dumpgz="$tmpdir/db/$database/$database.$TYPE.sql.gz"
         grants="$tmpdir/db/$database/conf/$database.$TYPE.$DBUSER"
         grants="$tmpdir/db/$database/conf/$database.$TYPE.$DBUSER"
-        case $TYPE in
-            mysql) dump_mysql_database ;;
-            pgsql) dump_pgsql_database ;;
-        esac
-
-        # Compress dump
-        gzip -$BACKUP_GZIP $dump
+        if [ ! -f "$dumpgz" ]; then
+            case $TYPE in
+                mysql) dump_mysql_database ;;
+                pgsql) dump_pgsql_database ;;
+            esac
+
+            # Compress dump
+            gzip -$BACKUP_GZIP $dump
+        fi
     done
     done
 
 
     # Print total
     # Print total

+ 3 - 0
bin/v-backup-users

@@ -28,6 +28,9 @@ if [ -z "$BACKUP_SYSTEM" ]; then
     exit
     exit
 fi
 fi
 for user in $(grep '@' /etc/passwd |cut -f1 -d:); do
 for user in $(grep '@' /etc/passwd |cut -f1 -d:); do
+    if [ ! -f "$VESTA/data/users/$user/user.conf" ]; then
+        continue;
+    fi
     check_suspend=$(grep "SUSPENDED='no'" $VESTA/data/users/$user/user.conf)
     check_suspend=$(grep "SUSPENDED='no'" $VESTA/data/users/$user/user.conf)
     log=$VESTA/log/backup.log
     log=$VESTA/log/backup.log
     if [ ! -z "$check_suspend" ]; then
     if [ ! -z "$check_suspend" ]; then

+ 18 - 7
bin/v-list-users

@@ -15,9 +15,14 @@ format=${1-shell}
 # JSON list function
 # JSON list function
 json_list() {
 json_list() {
     echo '{'
     echo '{'
-    object_count=$(grep '@' /etc/passwd |wc -l)
     i=1
     i=1
     while read USER; do
     while read USER; do
+        if [ ! -f "$VESTA/data/users/$USER/user.conf" ]; then
+            continue;
+        fi
+        if [ $i -gt 1 ]; then
+            echo ","
+        fi
         source $VESTA/data/users/$USER/user.conf
         source $VESTA/data/users/$USER/user.conf
         echo -n '    "'$USER'": {
         echo -n '    "'$USER'": {
         "FNAME": "'$FNAME'",
         "FNAME": "'$FNAME'",
@@ -74,14 +79,8 @@ json_list() {
         "TIME": "'$TIME'",
         "TIME": "'$TIME'",
         "DATE": "'$DATE'"
         "DATE": "'$DATE'"
         }'
         }'
-        if [ "$i" -lt "$object_count" ]; then
-            echo ','
-        else
-            echo
-        fi
         ((i++))
         ((i++))
     done < <(grep '@' /etc/passwd |cut -f1 -d:)
     done < <(grep '@' /etc/passwd |cut -f1 -d:)
-
     echo '}'
     echo '}'
 }
 }
 
 
@@ -90,6 +89,9 @@ shell_list() {
     echo "USER   PKG   WEB   DNS   MAIL   DB   DISK   BW   SPND   DATE"
     echo "USER   PKG   WEB   DNS   MAIL   DB   DISK   BW   SPND   DATE"
     echo "----   ---   ---   ---   ---    --   ----   --   ----   ----"
     echo "----   ---   ---   ---   ---    --   ----   --   ----   ----"
     while read USER; do
     while read USER; do
+        if [ ! -f "$VESTA/data/users/$USER/user.conf" ]; then
+            continue;
+        fi
         source $VESTA/data/users/$USER/user.conf
         source $VESTA/data/users/$USER/user.conf
         echo -n "$USER $PACKAGE $U_WEB_DOMAINS $U_DNS_DOMAINS $U_MAIL_DOMAINS"
         echo -n "$USER $PACKAGE $U_WEB_DOMAINS $U_DNS_DOMAINS $U_MAIL_DOMAINS"
         echo " $U_DATABASES $U_DISK $U_BANDWIDTH $SUSPENDED $DATE"
         echo " $U_DATABASES $U_DISK $U_BANDWIDTH $SUSPENDED $DATE"
@@ -99,6 +101,9 @@ shell_list() {
 # PLAIN list function
 # PLAIN list function
 plain_list() {
 plain_list() {
     while read USER; do
     while read USER; do
+        if [ ! -f "$VESTA/data/users/$USER/user.conf" ]; then
+            continue;
+        fi
         source $VESTA/data/users/$USER/user.conf
         source $VESTA/data/users/$USER/user.conf
         echo -ne "$USER\t$FNAME\t$LNAME\t$PACKAGE\t$WEB_TEMPLATE\t"
         echo -ne "$USER\t$FNAME\t$LNAME\t$PACKAGE\t$WEB_TEMPLATE\t"
         echo -ne "$BACKEND_TEMPLATE\t$PROXY_TEMPLATE\t$DNS_TEMPLATE\t"
         echo -ne "$BACKEND_TEMPLATE\t$PROXY_TEMPLATE\t$DNS_TEMPLATE\t"
@@ -131,6 +136,9 @@ csv_list() {
     echo -n "U_MAIL_DOMAINS,U_MAIL_DKIM,U_MAIL_ACCOUNTS,U_DATABASES"
     echo -n "U_MAIL_DOMAINS,U_MAIL_DKIM,U_MAIL_ACCOUNTS,U_DATABASES"
     echo "U_CRON_JOBS,U_BACKUPS,LANGUAGE,TIME,DATE"
     echo "U_CRON_JOBS,U_BACKUPS,LANGUAGE,TIME,DATE"
     while read USER; do
     while read USER; do
+        if [ ! -f "$VESTA/data/users/$USER/user.conf" ]; then
+            continue;
+        fi
         source $VESTA/data/users/$USER/user.conf
         source $VESTA/data/users/$USER/user.conf
         echo -n "$USER,\"$FNAME\",\"$LNAME\",$PACKAGE,$WEB_TEMPLATE,"
         echo -n "$USER,\"$FNAME\",\"$LNAME\",$PACKAGE,$WEB_TEMPLATE,"
         echo -n "$BACKEND_TEMPLATE,$PROXY_TEMPLATE,$DNS_TEMPLATE,"
         echo -n "$BACKEND_TEMPLATE,$PROXY_TEMPLATE,$DNS_TEMPLATE,"
@@ -151,6 +159,9 @@ csv_list() {
 # Raw list function
 # Raw list function
 raw_list() {
 raw_list() {
     while read USER; do
     while read USER; do
+        if [ ! -f "$VESTA/data/users/$USER/user.conf" ]; then
+            continue;
+        fi
         echo $VESTA/data/users/$USER/user.conf
         echo $VESTA/data/users/$USER/user.conf
         cat $VESTA/data/users/$USER/user.conf
         cat $VESTA/data/users/$USER/user.conf
     done < <(grep '@' /etc/passwd |cut -f1 -d:)
     done < <(grep '@' /etc/passwd |cut -f1 -d:)

+ 1 - 0
bin/v-list-web-domain-ssl

@@ -19,6 +19,7 @@ source $VESTA/func/main.sh
 
 
 # JSON list function
 # JSON list function
 json_list() {
 json_list() {
+    issuer=$(echo "$issuer" |sed -e 's/"/\\"/g' -e "s/%quote%/'/g")
     echo '{'
     echo '{'
     echo -e "\t\"$domain\": {"
     echo -e "\t\"$domain\": {"
     echo "        \"CRT\": \"$crt\","
     echo "        \"CRT\": \"$crt\","

+ 5 - 0
bin/v-open-fs-config

@@ -35,6 +35,11 @@ if [ ! -z "$src_file" ]; then
         echo "Error: invalid source path $src_file"
         echo "Error: invalid source path $src_file"
         exit 2
         exit 2
     fi
     fi
+    spath=$(echo "$rpath" |egrep "/etc|/var/lib")
+    if [ -z "$spath" ]; then
+        echo "Error: invalid source path $src_file"
+        exit 2
+    fi
 fi
 fi
 
 
 # Reading conf
 # Reading conf

+ 5 - 1
bin/v-update-letsencrypt-ssl

@@ -31,7 +31,11 @@ for user in $users; do
     # Checking user certificates
     # Checking user certificates
     lecounter=0
     lecounter=0
     for domain in $(search_objects 'web' 'LETSENCRYPT' 'yes' 'DOMAIN'); do
     for domain in $(search_objects 'web' 'LETSENCRYPT' 'yes' 'DOMAIN'); do
-
+        # Working on Web domain check - if is suspended
+        webSuspended=$(grep "DOMAIN='$domain'" $USER_DATA/web.conf |grep "SUSPENDED='no")
+        if [ ! -z "$webSuspended" ]; then
+                continue;
+        fi;
         crt="$VESTA/data/users/$user/ssl/$domain.crt"
         crt="$VESTA/data/users/$user/ssl/$domain.crt"
         crt_data=$(openssl x509 -text -in "$crt")
         crt_data=$(openssl x509 -text -in "$crt")
         expire=$(echo "$crt_data" |grep "Not After")
         expire=$(echo "$crt_data" |grep "Not After")

+ 3 - 0
bin/v-update-user-stats

@@ -67,6 +67,9 @@ TOTAL_USERS=0
 
 
 # Updating user stats
 # Updating user stats
 for user in $user_list; do
 for user in $user_list; do
+    if [ ! -f "$VESTA/data/users/$user/user.conf" ]; then
+        continue;
+    fi
     USER_DATA=$VESTA/data/users/$user
     USER_DATA=$VESTA/data/users/$user
     source $USER_DATA/user.conf
     source $USER_DATA/user.conf
     next_month=$(date +'%m/01/%y' -d '+ 1 month')
     next_month=$(date +'%m/01/%y' -d '+ 1 month')

+ 14 - 3
func/main.sh

@@ -805,7 +805,16 @@ is_password_format_valid() {
         check_result $E_INVALID "invalid password format :: $1"
         check_result $E_INVALID "invalid password format :: $1"
     fi
     fi
 }
 }
-
+# Missing function - 
+# Before: validate_format_shell 
+# After: is_format_valid_shell
+is_format_valid_shell() {	
+    if [ -z "$(grep -w $1 /etc/shells)" ]; then	
+        echo "Error: shell $1 is not valid"	
+        log_event "$E_INVALID" "$EVENT"	
+        exit $E_INVALID	
+    fi	
+}
 # Format validation controller
 # Format validation controller
 is_format_valid() {
 is_format_valid() {
     for arg_name in $*; do
     for arg_name in $*; do
@@ -872,7 +881,9 @@ is_format_valid() {
                 restart)        is_boolean_format_valid "$arg" 'restart' ;;
                 restart)        is_boolean_format_valid "$arg" 'restart' ;;
                 rtype)          is_dns_type_format_valid "$arg" ;;
                 rtype)          is_dns_type_format_valid "$arg" ;;
                 rule)           is_int_format_valid "$arg" "rule id" ;;
                 rule)           is_int_format_valid "$arg" "rule id" ;;
-                soa)            is_domain_format_valid "$arg" 'SOA' ;;
+                soa)            is_domain_format_valid "$arg" 'SOA' ;;	
+                #missing command: is_format_valid_shell
+                shell)          is_format_valid_shell "$arg" ;;
                 stats_pass)     is_password_format_valid "$arg" ;;
                 stats_pass)     is_password_format_valid "$arg" ;;
                 stats_user)     is_user_format_valid "$arg" "$arg_name" ;;
                 stats_user)     is_user_format_valid "$arg" "$arg_name" ;;
                 template)       is_object_format_valid "$arg" "$arg_name" ;;
                 template)       is_object_format_valid "$arg" "$arg_name" ;;
@@ -922,7 +933,7 @@ format_aliases() {
         aliases=$(echo "$aliases" |tr -s '.')
         aliases=$(echo "$aliases" |tr -s '.')
         aliases=$(echo "$aliases" |sed -e "s/[.]*$//g")
         aliases=$(echo "$aliases" |sed -e "s/[.]*$//g")
         aliases=$(echo "$aliases" |sed -e "s/^[.]*//")
         aliases=$(echo "$aliases" |sed -e "s/^[.]*//")
-        aliases=$(echo "$aliases" |grep -v www.$domain |sed -e "/^$/d")
+        aliases=$(echo "$aliases" |sed -e "/^$/d")
         aliases=$(echo "$aliases" |tr '\n' ',' |sed -e "s/,$//")
         aliases=$(echo "$aliases" |tr '\n' ',' |sed -e "s/,$//")
     fi
     fi
 }
 }

+ 1 - 0
install/debian/7/nginx/nginx.conf

@@ -50,6 +50,7 @@ http {
 
 
     # Compression
     # Compression
     gzip                on;
     gzip                on;
+    gzip_vary           on;
     gzip_comp_level     9;
     gzip_comp_level     9;
     gzip_min_length     512;
     gzip_min_length     512;
     gzip_buffers        8 64k;
     gzip_buffers        8 64k;

+ 1 - 1
install/debian/7/sudo/admin

@@ -4,5 +4,5 @@ Defaults:admin !syslog
 Defaults:admin !requiretty
 Defaults:admin !requiretty
 Defaults:root !requiretty
 Defaults:root !requiretty
 
 
-admin   ALL=(ALL)       ALL
+# sudo is limited to vesta scripts
 admin   ALL=NOPASSWD:/usr/local/vesta/bin/*
 admin   ALL=NOPASSWD:/usr/local/vesta/bin/*

+ 23 - 29
install/debian/7/templates/web/nginx/php5-fpm/drupal6.stpl

@@ -31,48 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
     }
     }
 
 
     location @rewrite {
     location @rewrite {
-        # For Drupal 6 and bwlow:
-        # Some modules enforce no slash (/) at the end of the URL
-        # Else this rewrite block wouldn't be needed (GlobalRedirect)
         rewrite ^/(.*)$ /index.php?q=$1;
         rewrite ^/(.*)$ /index.php?q=$1;
     }
     }
+    
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }    
+
+    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+        try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~ ^/sites/.*/files/imagecache/ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+    }    
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;             
+        include /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 21 - 28
install/debian/7/templates/web/nginx/php5-fpm/drupal6.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,49 +27,43 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
 
 
     location / {
     location / {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
     }
     }
 
 
     location @rewrite {
     location @rewrite {
-        # For Drupal 6 and bwlow:
-        # Some modules enforce no slash (/) at the end of the URL
-        # Else this rewrite block wouldn't be needed (GlobalRedirect)
         rewrite ^/(.*)$ /index.php?q=$1;
         rewrite ^/(.*)$ /index.php?q=$1;
     }
     }
+    
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }    
+
+    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+        try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~ ^/sites/.*/files/imagecache/ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
     }
     }
+        
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;             
+        include /etc/nginx/fastcgi_params;
+    }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;
     error_page  404 /error/404.html;

+ 25 - 31
install/debian/7/templates/web/nginx/php5-fpm/drupal7.stpl

@@ -31,48 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
+
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+    
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 24 - 31
install/debian/7/templates/web/nginx/php5-fpm/drupal7.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,48 +27,42 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
-
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
-
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 25 - 32
install/debian/7/templates/web/nginx/php5-fpm/drupal8.stpl

@@ -31,49 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
+
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$)|^/update.php {
-            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+    
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 24 - 32
install/debian/7/templates/web/nginx/php5-fpm/drupal8.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,49 +27,42 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
-
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
-
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~ [^/]\.php(/|$)|^/update.php {
-            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 1 - 0
install/debian/8/nginx/nginx.conf

@@ -51,6 +51,7 @@ http {
 
 
     # Compression
     # Compression
     gzip                on;
     gzip                on;
+    gzip_vary           on;
     gzip_comp_level     9;
     gzip_comp_level     9;
     gzip_min_length     512;
     gzip_min_length     512;
     gzip_buffers        8 64k;
     gzip_buffers        8 64k;

+ 1 - 1
install/debian/8/sudo/admin

@@ -4,5 +4,5 @@ Defaults:admin !syslog
 Defaults:admin !requiretty
 Defaults:admin !requiretty
 Defaults:root !requiretty
 Defaults:root !requiretty
 
 
-admin   ALL=(ALL)       ALL
+# sudo is limited to vesta scripts
 admin   ALL=NOPASSWD:/usr/local/vesta/bin/*
 admin   ALL=NOPASSWD:/usr/local/vesta/bin/*

+ 23 - 29
install/debian/8/templates/web/nginx/php5-fpm/drupal6.stpl

@@ -31,48 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
     }
     }
 
 
     location @rewrite {
     location @rewrite {
-        # For Drupal 6 and bwlow:
-        # Some modules enforce no slash (/) at the end of the URL
-        # Else this rewrite block wouldn't be needed (GlobalRedirect)
         rewrite ^/(.*)$ /index.php?q=$1;
         rewrite ^/(.*)$ /index.php?q=$1;
     }
     }
+    
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }    
+
+    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+        try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~ ^/sites/.*/files/imagecache/ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+    }    
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;             
+        include /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 21 - 28
install/debian/8/templates/web/nginx/php5-fpm/drupal6.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,49 +27,43 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
 
 
     location / {
     location / {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
     }
     }
 
 
     location @rewrite {
     location @rewrite {
-        # For Drupal 6 and bwlow:
-        # Some modules enforce no slash (/) at the end of the URL
-        # Else this rewrite block wouldn't be needed (GlobalRedirect)
         rewrite ^/(.*)$ /index.php?q=$1;
         rewrite ^/(.*)$ /index.php?q=$1;
     }
     }
+    
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }    
+
+    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+        try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~ ^/sites/.*/files/imagecache/ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
     }
     }
+        
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;             
+        include /etc/nginx/fastcgi_params;
+    }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;
     error_page  404 /error/404.html;

+ 25 - 31
install/debian/8/templates/web/nginx/php5-fpm/drupal7.stpl

@@ -31,48 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
+
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+    
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 24 - 31
install/debian/8/templates/web/nginx/php5-fpm/drupal7.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,48 +27,42 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
-
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
-
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 25 - 32
install/debian/8/templates/web/nginx/php5-fpm/drupal8.stpl

@@ -31,49 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
+
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$)|^/update.php {
-            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+    
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 24 - 32
install/debian/8/templates/web/nginx/php5-fpm/drupal8.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,49 +27,42 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
-
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
-
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~ [^/]\.php(/|$)|^/update.php {
-            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 1 - 0
install/debian/9/nginx/nginx.conf

@@ -51,6 +51,7 @@ http {
 
 
     # Compression
     # Compression
     gzip                on;
     gzip                on;
+    gzip_vary           on;
     gzip_comp_level     9;
     gzip_comp_level     9;
     gzip_min_length     512;
     gzip_min_length     512;
     gzip_buffers        8 64k;
     gzip_buffers        8 64k;

+ 1 - 1
install/debian/9/sudo/admin

@@ -4,5 +4,5 @@ Defaults:admin !syslog
 Defaults:admin !requiretty
 Defaults:admin !requiretty
 Defaults:root !requiretty
 Defaults:root !requiretty
 
 
-admin   ALL=(ALL)       ALL
+# sudo is limited to vesta scripts
 admin   ALL=NOPASSWD:/usr/local/vesta/bin/*
 admin   ALL=NOPASSWD:/usr/local/vesta/bin/*

+ 23 - 29
install/debian/9/templates/web/nginx/php-fpm/drupal6.stpl

@@ -31,48 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
     }
     }
 
 
     location @rewrite {
     location @rewrite {
-        # For Drupal 6 and bwlow:
-        # Some modules enforce no slash (/) at the end of the URL
-        # Else this rewrite block wouldn't be needed (GlobalRedirect)
         rewrite ^/(.*)$ /index.php?q=$1;
         rewrite ^/(.*)$ /index.php?q=$1;
     }
     }
+    
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }    
+
+    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+        try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~ ^/sites/.*/files/imagecache/ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+    }    
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;             
+        include /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 21 - 28
install/debian/9/templates/web/nginx/php-fpm/drupal6.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,49 +27,43 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
 
 
     location / {
     location / {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
     }
     }
 
 
     location @rewrite {
     location @rewrite {
-        # For Drupal 6 and bwlow:
-        # Some modules enforce no slash (/) at the end of the URL
-        # Else this rewrite block wouldn't be needed (GlobalRedirect)
         rewrite ^/(.*)$ /index.php?q=$1;
         rewrite ^/(.*)$ /index.php?q=$1;
     }
     }
+    
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }    
+
+    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+        try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~ ^/sites/.*/files/imagecache/ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
     }
     }
+        
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;             
+        include /etc/nginx/fastcgi_params;
+    }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;
     error_page  404 /error/404.html;

+ 25 - 31
install/debian/9/templates/web/nginx/php-fpm/drupal7.stpl

@@ -31,48 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
+
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+    
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 24 - 31
install/debian/9/templates/web/nginx/php-fpm/drupal7.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,48 +27,42 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
-
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
-
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 25 - 32
install/debian/9/templates/web/nginx/php-fpm/drupal8.stpl

@@ -31,49 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
+
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$)|^/update.php {
-            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+    
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 24 - 32
install/debian/9/templates/web/nginx/php-fpm/drupal8.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,49 +27,42 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
-
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
-
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~ [^/]\.php(/|$)|^/update.php {
-            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 1 - 0
install/rhel/5/nginx/nginx.conf

@@ -50,6 +50,7 @@ http {
 
 
     # Compression
     # Compression
     gzip                on;
     gzip                on;
+    gzip_vary           on;
     gzip_comp_level     9;
     gzip_comp_level     9;
     gzip_min_length     512;
     gzip_min_length     512;
     gzip_buffers        8 64k;
     gzip_buffers        8 64k;

+ 1 - 1
install/rhel/5/sudo/admin

@@ -4,5 +4,5 @@ Defaults:admin !syslog
 Defaults:admin !requiretty
 Defaults:admin !requiretty
 Defaults:root !requiretty
 Defaults:root !requiretty
 
 
-admin   ALL=(ALL)       ALL
+# sudo is limited to vesta scripts
 admin   ALL=NOPASSWD:/usr/local/vesta/bin/*
 admin   ALL=NOPASSWD:/usr/local/vesta/bin/*

+ 23 - 29
install/rhel/5/templates/web/nginx/php-fpm/drupal6.stpl

@@ -31,48 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
     }
     }
 
 
     location @rewrite {
     location @rewrite {
-        # For Drupal 6 and bwlow:
-        # Some modules enforce no slash (/) at the end of the URL
-        # Else this rewrite block wouldn't be needed (GlobalRedirect)
         rewrite ^/(.*)$ /index.php?q=$1;
         rewrite ^/(.*)$ /index.php?q=$1;
     }
     }
+    
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }    
+
+    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+        try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~ ^/sites/.*/files/imagecache/ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+    }    
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;             
+        include /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 21 - 28
install/rhel/5/templates/web/nginx/php-fpm/drupal6.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,49 +27,43 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
 
 
     location / {
     location / {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
     }
     }
 
 
     location @rewrite {
     location @rewrite {
-        # For Drupal 6 and bwlow:
-        # Some modules enforce no slash (/) at the end of the URL
-        # Else this rewrite block wouldn't be needed (GlobalRedirect)
         rewrite ^/(.*)$ /index.php?q=$1;
         rewrite ^/(.*)$ /index.php?q=$1;
     }
     }
+    
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }    
+
+    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+        try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~ ^/sites/.*/files/imagecache/ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
     }
     }
+        
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;             
+        include /etc/nginx/fastcgi_params;
+    }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;
     error_page  404 /error/404.html;

+ 25 - 31
install/rhel/5/templates/web/nginx/php-fpm/drupal7.stpl

@@ -31,48 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
+
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+    
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 24 - 31
install/rhel/5/templates/web/nginx/php-fpm/drupal7.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,48 +27,42 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
-
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
-
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 25 - 32
install/rhel/5/templates/web/nginx/php-fpm/drupal8.stpl

@@ -31,49 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
+
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$)|^/update.php {
-            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+    
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 24 - 32
install/rhel/5/templates/web/nginx/php-fpm/drupal8.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,49 +27,42 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
-
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
-
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~ [^/]\.php(/|$)|^/update.php {
-            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 1 - 0
install/rhel/6/nginx/nginx.conf

@@ -50,6 +50,7 @@ http {
 
 
     # Compression
     # Compression
     gzip                on;
     gzip                on;
+    gzip_vary           on;
     gzip_comp_level     9;
     gzip_comp_level     9;
     gzip_min_length     512;
     gzip_min_length     512;
     gzip_buffers        8 64k;
     gzip_buffers        8 64k;

+ 1 - 1
install/rhel/6/sudo/admin

@@ -4,5 +4,5 @@ Defaults:admin !syslog
 Defaults:admin !requiretty
 Defaults:admin !requiretty
 Defaults:root !requiretty
 Defaults:root !requiretty
 
 
-admin   ALL=(ALL)       ALL
+# sudo is limited to vesta scripts
 admin   ALL=NOPASSWD:/usr/local/vesta/bin/*
 admin   ALL=NOPASSWD:/usr/local/vesta/bin/*

+ 23 - 29
install/rhel/6/templates/web/nginx/php-fpm/drupal6.stpl

@@ -31,48 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
     }
     }
 
 
     location @rewrite {
     location @rewrite {
-        # For Drupal 6 and bwlow:
-        # Some modules enforce no slash (/) at the end of the URL
-        # Else this rewrite block wouldn't be needed (GlobalRedirect)
         rewrite ^/(.*)$ /index.php?q=$1;
         rewrite ^/(.*)$ /index.php?q=$1;
     }
     }
+    
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }    
+
+    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+        try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~ ^/sites/.*/files/imagecache/ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+    }    
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;             
+        include /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 21 - 28
install/rhel/6/templates/web/nginx/php-fpm/drupal6.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,49 +27,43 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
 
 
     location / {
     location / {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
     }
     }
 
 
     location @rewrite {
     location @rewrite {
-        # For Drupal 6 and bwlow:
-        # Some modules enforce no slash (/) at the end of the URL
-        # Else this rewrite block wouldn't be needed (GlobalRedirect)
         rewrite ^/(.*)$ /index.php?q=$1;
         rewrite ^/(.*)$ /index.php?q=$1;
     }
     }
+    
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }    
+
+    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+        try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~ ^/sites/.*/files/imagecache/ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
     }
     }
+        
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;             
+        include /etc/nginx/fastcgi_params;
+    }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;
     error_page  404 /error/404.html;

+ 25 - 31
install/rhel/6/templates/web/nginx/php-fpm/drupal7.stpl

@@ -31,48 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
+
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+    
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 24 - 31
install/rhel/6/templates/web/nginx/php-fpm/drupal7.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,48 +27,42 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
-
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
-
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 25 - 32
install/rhel/6/templates/web/nginx/php-fpm/drupal8.stpl

@@ -31,49 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
+
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$)|^/update.php {
-            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+    
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 24 - 32
install/rhel/6/templates/web/nginx/php-fpm/drupal8.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,49 +27,42 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
-
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
-
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~ [^/]\.php(/|$)|^/update.php {
-            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 1 - 0
install/rhel/7/nginx/nginx.conf

@@ -50,6 +50,7 @@ http {
 
 
     # Compression
     # Compression
     gzip                on;
     gzip                on;
+    gzip_vary           on;
     gzip_comp_level     9;
     gzip_comp_level     9;
     gzip_min_length     512;
     gzip_min_length     512;
     gzip_buffers        8 64k;
     gzip_buffers        8 64k;

+ 1 - 1
install/rhel/7/sudo/admin

@@ -4,5 +4,5 @@ Defaults:admin !syslog
 Defaults:admin !requiretty
 Defaults:admin !requiretty
 Defaults:root !requiretty
 Defaults:root !requiretty
 
 
-admin   ALL=(ALL)       ALL
+# sudo is limited to vesta scripts
 admin   ALL=NOPASSWD:/usr/local/vesta/bin/*
 admin   ALL=NOPASSWD:/usr/local/vesta/bin/*

+ 23 - 29
install/rhel/7/templates/web/nginx/php-fpm/drupal6.stpl

@@ -31,48 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
     }
     }
 
 
     location @rewrite {
     location @rewrite {
-        # For Drupal 6 and bwlow:
-        # Some modules enforce no slash (/) at the end of the URL
-        # Else this rewrite block wouldn't be needed (GlobalRedirect)
         rewrite ^/(.*)$ /index.php?q=$1;
         rewrite ^/(.*)$ /index.php?q=$1;
     }
     }
+    
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }    
+
+    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+        try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~ ^/sites/.*/files/imagecache/ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+    }    
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;             
+        include /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 21 - 28
install/rhel/7/templates/web/nginx/php-fpm/drupal6.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,49 +27,43 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
 
 
     location / {
     location / {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
     }
     }
 
 
     location @rewrite {
     location @rewrite {
-        # For Drupal 6 and bwlow:
-        # Some modules enforce no slash (/) at the end of the URL
-        # Else this rewrite block wouldn't be needed (GlobalRedirect)
         rewrite ^/(.*)$ /index.php?q=$1;
         rewrite ^/(.*)$ /index.php?q=$1;
     }
     }
+    
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }    
+
+    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+        try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~ ^/sites/.*/files/imagecache/ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
     }
     }
+        
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;             
+        include /etc/nginx/fastcgi_params;
+    }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;
     error_page  404 /error/404.html;

+ 25 - 31
install/rhel/7/templates/web/nginx/php-fpm/drupal7.stpl

@@ -31,48 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
+
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+    
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 24 - 31
install/rhel/7/templates/web/nginx/php-fpm/drupal7.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,48 +27,42 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
-
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
-
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 25 - 32
install/rhel/7/templates/web/nginx/php-fpm/drupal8.stpl

@@ -31,49 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
+
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$)|^/update.php {
-            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+    
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 24 - 32
install/rhel/7/templates/web/nginx/php-fpm/drupal8.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,49 +27,42 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
-
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
-
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~ [^/]\.php(/|$)|^/update.php {
-            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 1 - 0
install/ubuntu/12.04/nginx/nginx.conf

@@ -50,6 +50,7 @@ http {
 
 
     # Compression
     # Compression
     gzip                on;
     gzip                on;
+    gzip_vary           on;
     gzip_comp_level     9;
     gzip_comp_level     9;
     gzip_min_length     512;
     gzip_min_length     512;
     gzip_buffers        8 64k;
     gzip_buffers        8 64k;

+ 1 - 1
install/ubuntu/12.04/sudo/admin

@@ -4,5 +4,5 @@ Defaults:admin !syslog
 Defaults:admin !requiretty
 Defaults:admin !requiretty
 Defaults:root !requiretty
 Defaults:root !requiretty
 
 
-admin   ALL=(ALL)       ALL
+# sudo is limited to vesta scripts
 admin   ALL=NOPASSWD:/usr/local/vesta/bin/*
 admin   ALL=NOPASSWD:/usr/local/vesta/bin/*

+ 23 - 29
install/ubuntu/12.04/templates/web/nginx/php-fpm/drupal6.stpl

@@ -31,48 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
     }
     }
 
 
     location @rewrite {
     location @rewrite {
-        # For Drupal 6 and bwlow:
-        # Some modules enforce no slash (/) at the end of the URL
-        # Else this rewrite block wouldn't be needed (GlobalRedirect)
         rewrite ^/(.*)$ /index.php?q=$1;
         rewrite ^/(.*)$ /index.php?q=$1;
     }
     }
+    
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }    
+
+    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+        try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~ ^/sites/.*/files/imagecache/ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+    }    
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;             
+        include /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 21 - 28
install/ubuntu/12.04/templates/web/nginx/php-fpm/drupal6.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,49 +27,43 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
 
 
     location / {
     location / {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
     }
     }
 
 
     location @rewrite {
     location @rewrite {
-        # For Drupal 6 and bwlow:
-        # Some modules enforce no slash (/) at the end of the URL
-        # Else this rewrite block wouldn't be needed (GlobalRedirect)
         rewrite ^/(.*)$ /index.php?q=$1;
         rewrite ^/(.*)$ /index.php?q=$1;
     }
     }
+    
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }    
+
+    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+        try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~ ^/sites/.*/files/imagecache/ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
     }
     }
+        
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;             
+        include /etc/nginx/fastcgi_params;
+    }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;
     error_page  404 /error/404.html;

+ 25 - 31
install/ubuntu/12.04/templates/web/nginx/php-fpm/drupal7.stpl

@@ -31,48 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
+
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+    
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 24 - 31
install/ubuntu/12.04/templates/web/nginx/php-fpm/drupal7.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,48 +27,42 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
-
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
-
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 25 - 32
install/ubuntu/12.04/templates/web/nginx/php-fpm/drupal8.stpl

@@ -31,49 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
+
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$)|^/update.php {
-            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+    
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 24 - 32
install/ubuntu/12.04/templates/web/nginx/php-fpm/drupal8.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,49 +27,42 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
-
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
-
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~ [^/]\.php(/|$)|^/update.php {
-            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 1 - 0
install/ubuntu/12.10/nginx/nginx.conf

@@ -50,6 +50,7 @@ http {
 
 
     # Compression
     # Compression
     gzip                on;
     gzip                on;
+    gzip_vary           on;
     gzip_comp_level     9;
     gzip_comp_level     9;
     gzip_min_length     512;
     gzip_min_length     512;
     gzip_buffers        8 64k;
     gzip_buffers        8 64k;

+ 1 - 1
install/ubuntu/12.10/sudo/admin

@@ -4,5 +4,5 @@ Defaults:admin !syslog
 Defaults:admin !requiretty
 Defaults:admin !requiretty
 Defaults:root !requiretty
 Defaults:root !requiretty
 
 
-admin   ALL=(ALL)       ALL
+# sudo is limited to vesta scripts
 admin   ALL=NOPASSWD:/usr/local/vesta/bin/*
 admin   ALL=NOPASSWD:/usr/local/vesta/bin/*

+ 23 - 29
install/ubuntu/12.10/templates/web/nginx/php-fpm/drupal6.stpl

@@ -31,48 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
     }
     }
 
 
     location @rewrite {
     location @rewrite {
-        # For Drupal 6 and bwlow:
-        # Some modules enforce no slash (/) at the end of the URL
-        # Else this rewrite block wouldn't be needed (GlobalRedirect)
         rewrite ^/(.*)$ /index.php?q=$1;
         rewrite ^/(.*)$ /index.php?q=$1;
     }
     }
+    
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }    
+
+    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+        try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~ ^/sites/.*/files/imagecache/ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+    }    
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;             
+        include /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 21 - 28
install/ubuntu/12.10/templates/web/nginx/php-fpm/drupal6.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,49 +27,43 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
 
 
     location / {
     location / {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
     }
     }
 
 
     location @rewrite {
     location @rewrite {
-        # For Drupal 6 and bwlow:
-        # Some modules enforce no slash (/) at the end of the URL
-        # Else this rewrite block wouldn't be needed (GlobalRedirect)
         rewrite ^/(.*)$ /index.php?q=$1;
         rewrite ^/(.*)$ /index.php?q=$1;
     }
     }
+    
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }    
+
+    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+        try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~ ^/sites/.*/files/imagecache/ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
     }
     }
+        
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;             
+        include /etc/nginx/fastcgi_params;
+    }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;
     error_page  404 /error/404.html;

+ 25 - 31
install/ubuntu/12.10/templates/web/nginx/php-fpm/drupal7.stpl

@@ -31,48 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
+
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+    
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 24 - 31
install/ubuntu/12.10/templates/web/nginx/php-fpm/drupal7.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,48 +27,42 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
-
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
-
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 25 - 32
install/ubuntu/12.10/templates/web/nginx/php-fpm/drupal8.stpl

@@ -31,49 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
+
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$)|^/update.php {
-            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+    
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 24 - 32
install/ubuntu/12.10/templates/web/nginx/php-fpm/drupal8.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,49 +27,42 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
-
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
-
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~ [^/]\.php(/|$)|^/update.php {
-            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 1 - 0
install/ubuntu/13.04/nginx/nginx.conf

@@ -50,6 +50,7 @@ http {
 
 
     # Compression
     # Compression
     gzip                on;
     gzip                on;
+    gzip_vary           on;
     gzip_comp_level     9;
     gzip_comp_level     9;
     gzip_min_length     512;
     gzip_min_length     512;
     gzip_buffers        8 64k;
     gzip_buffers        8 64k;

+ 1 - 1
install/ubuntu/13.04/sudo/admin

@@ -4,5 +4,5 @@ Defaults:admin !syslog
 Defaults:admin !requiretty
 Defaults:admin !requiretty
 Defaults:root !requiretty
 Defaults:root !requiretty
 
 
-admin   ALL=(ALL)       ALL
+# sudo is limited to vesta scripts
 admin   ALL=NOPASSWD:/usr/local/vesta/bin/*
 admin   ALL=NOPASSWD:/usr/local/vesta/bin/*

+ 23 - 29
install/ubuntu/13.04/templates/web/nginx/php-fpm/drupal6.stpl

@@ -31,48 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
     }
     }
 
 
     location @rewrite {
     location @rewrite {
-        # For Drupal 6 and bwlow:
-        # Some modules enforce no slash (/) at the end of the URL
-        # Else this rewrite block wouldn't be needed (GlobalRedirect)
         rewrite ^/(.*)$ /index.php?q=$1;
         rewrite ^/(.*)$ /index.php?q=$1;
     }
     }
+    
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }    
+
+    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+        try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~ ^/sites/.*/files/imagecache/ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+    }    
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;             
+        include /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 21 - 28
install/ubuntu/13.04/templates/web/nginx/php-fpm/drupal6.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,49 +27,43 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
 
 
     location / {
     location / {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
     }
     }
 
 
     location @rewrite {
     location @rewrite {
-        # For Drupal 6 and bwlow:
-        # Some modules enforce no slash (/) at the end of the URL
-        # Else this rewrite block wouldn't be needed (GlobalRedirect)
         rewrite ^/(.*)$ /index.php?q=$1;
         rewrite ^/(.*)$ /index.php?q=$1;
     }
     }
+    
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }    
+
+    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+        try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~ ^/sites/.*/files/imagecache/ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
     }
     }
+        
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;             
+        include /etc/nginx/fastcgi_params;
+    }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;
     error_page  404 /error/404.html;

+ 25 - 31
install/ubuntu/13.04/templates/web/nginx/php-fpm/drupal7.stpl

@@ -31,48 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
+
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+    
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 24 - 31
install/ubuntu/13.04/templates/web/nginx/php-fpm/drupal7.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,48 +27,42 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
-
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
-
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 25 - 32
install/ubuntu/13.04/templates/web/nginx/php-fpm/drupal8.stpl

@@ -31,49 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
+
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$)|^/update.php {
-            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+    
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 24 - 32
install/ubuntu/13.04/templates/web/nginx/php-fpm/drupal8.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,49 +27,42 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
-
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
-
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~ [^/]\.php(/|$)|^/update.php {
-            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 1 - 0
install/ubuntu/13.10/nginx/nginx.conf

@@ -50,6 +50,7 @@ http {
 
 
     # Compression
     # Compression
     gzip                on;
     gzip                on;
+    gzip_vary           on;
     gzip_comp_level     9;
     gzip_comp_level     9;
     gzip_min_length     512;
     gzip_min_length     512;
     gzip_buffers        8 64k;
     gzip_buffers        8 64k;

+ 1 - 1
install/ubuntu/13.10/sudo/admin

@@ -4,5 +4,5 @@ Defaults:admin !syslog
 Defaults:admin !requiretty
 Defaults:admin !requiretty
 Defaults:root !requiretty
 Defaults:root !requiretty
 
 
-admin   ALL=(ALL)       ALL
+# sudo is limited to vesta scripts
 admin   ALL=NOPASSWD:/usr/local/vesta/bin/*
 admin   ALL=NOPASSWD:/usr/local/vesta/bin/*

+ 23 - 29
install/ubuntu/13.10/templates/web/nginx/php-fpm/drupal6.stpl

@@ -31,48 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
     }
     }
 
 
     location @rewrite {
     location @rewrite {
-        # For Drupal 6 and bwlow:
-        # Some modules enforce no slash (/) at the end of the URL
-        # Else this rewrite block wouldn't be needed (GlobalRedirect)
         rewrite ^/(.*)$ /index.php?q=$1;
         rewrite ^/(.*)$ /index.php?q=$1;
     }
     }
+    
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }    
+
+    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+        try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~ ^/sites/.*/files/imagecache/ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+    }    
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;             
+        include /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 21 - 28
install/ubuntu/13.10/templates/web/nginx/php-fpm/drupal6.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,49 +27,43 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
 
 
     location / {
     location / {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
     }
     }
 
 
     location @rewrite {
     location @rewrite {
-        # For Drupal 6 and bwlow:
-        # Some modules enforce no slash (/) at the end of the URL
-        # Else this rewrite block wouldn't be needed (GlobalRedirect)
         rewrite ^/(.*)$ /index.php?q=$1;
         rewrite ^/(.*)$ /index.php?q=$1;
     }
     }
+    
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }    
+
+    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+        try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~ ^/sites/.*/files/imagecache/ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
     }
     }
+        
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;             
+        include /etc/nginx/fastcgi_params;
+    }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;
     error_page  404 /error/404.html;

+ 25 - 31
install/ubuntu/13.10/templates/web/nginx/php-fpm/drupal7.stpl

@@ -31,48 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
+
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+    
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 24 - 31
install/ubuntu/13.10/templates/web/nginx/php-fpm/drupal7.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,48 +27,42 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
-
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
-
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 25 - 32
install/ubuntu/13.10/templates/web/nginx/php-fpm/drupal8.stpl

@@ -31,49 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
+
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$)|^/update.php {
-            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+    
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 24 - 32
install/ubuntu/13.10/templates/web/nginx/php-fpm/drupal8.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,49 +27,42 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
-
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
-
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~ [^/]\.php(/|$)|^/update.php {
-            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 1 - 0
install/ubuntu/14.04/nginx/nginx.conf

@@ -50,6 +50,7 @@ http {
 
 
     # Compression
     # Compression
     gzip                on;
     gzip                on;
+    gzip_vary           on;
     gzip_comp_level     9;
     gzip_comp_level     9;
     gzip_min_length     512;
     gzip_min_length     512;
     gzip_buffers        8 64k;
     gzip_buffers        8 64k;

+ 1 - 1
install/ubuntu/14.04/sudo/admin

@@ -4,5 +4,5 @@ Defaults:admin !syslog
 Defaults:admin !requiretty
 Defaults:admin !requiretty
 Defaults:root !requiretty
 Defaults:root !requiretty
 
 
-admin   ALL=(ALL)       ALL
+# sudo is limited to vesta scripts
 admin   ALL=NOPASSWD:/usr/local/vesta/bin/*
 admin   ALL=NOPASSWD:/usr/local/vesta/bin/*

+ 23 - 29
install/ubuntu/14.04/templates/web/nginx/php-fpm/drupal6.stpl

@@ -31,48 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
     }
     }
 
 
     location @rewrite {
     location @rewrite {
-        # For Drupal 6 and bwlow:
-        # Some modules enforce no slash (/) at the end of the URL
-        # Else this rewrite block wouldn't be needed (GlobalRedirect)
         rewrite ^/(.*)$ /index.php?q=$1;
         rewrite ^/(.*)$ /index.php?q=$1;
     }
     }
+    
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }    
+
+    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+        try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~ ^/sites/.*/files/imagecache/ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+    }    
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;             
+        include /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 21 - 28
install/ubuntu/14.04/templates/web/nginx/php-fpm/drupal6.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,49 +27,43 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
 
 
     location / {
     location / {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
     }
     }
 
 
     location @rewrite {
     location @rewrite {
-        # For Drupal 6 and bwlow:
-        # Some modules enforce no slash (/) at the end of the URL
-        # Else this rewrite block wouldn't be needed (GlobalRedirect)
         rewrite ^/(.*)$ /index.php?q=$1;
         rewrite ^/(.*)$ /index.php?q=$1;
     }
     }
+    
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }    
+
+    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+        try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~ ^/sites/.*/files/imagecache/ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
     }
     }
+        
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;             
+        include /etc/nginx/fastcgi_params;
+    }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;
     error_page  404 /error/404.html;
     error_page  404 /error/404.html;

+ 25 - 31
install/ubuntu/14.04/templates/web/nginx/php-fpm/drupal7.stpl

@@ -31,48 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
+
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+    
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 24 - 31
install/ubuntu/14.04/templates/web/nginx/php-fpm/drupal7.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,48 +27,42 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
-
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
-
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~ [^/]\.php(/|$) {
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 25 - 32
install/ubuntu/14.04/templates/web/nginx/php-fpm/drupal8.stpl

@@ -31,49 +31,42 @@ server {
         return 403;
         return 403;
     }
     }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
 
 
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-            return 403;
-        }
-
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
+    }
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
+
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
-
-        location ~ [^/]\.php(/|$)|^/update.php {
-            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+    
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 24 - 32
install/ubuntu/14.04/templates/web/nginx/php-fpm/drupal8.tpl

@@ -18,7 +18,6 @@ server {
         access_log off;
         access_log off;
     }
     }
 
 
-    # Very rarely should these ever be accessed outside of your lan
     location ~* \.(txt|log)$ {
     location ~* \.(txt|log)$ {
         allow 192.168.0.0/16;
         allow 192.168.0.0/16;
         deny all;
         deny all;
@@ -28,49 +27,42 @@ server {
         return 403;
         return 403;
         }
         }
 
 
-    # No no for private
     location ~ ^/sites/.*/private/ {
     location ~ ^/sites/.*/private/ {
         return 403;
         return 403;
     }
     }
-
-    # Block access to "hidden" files and directories whose names begin with a
-    # period. This includes directories used by version control systems such
-    # as Subversion or Git to store control files.
-    location ~ (^|/)\. {
-        return 403;
+    
+    location ~ ^/sites/[^/]+/files/.*\.php$ {
+        deny all;
     }
     }
-
+    
     location / {
     location / {
-        try_files $uri @rewrite;
+        try_files $uri /index.php?$query_string;
+    }
 
 
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
-        }
+    location ~ /vendor/.*\.php$ {
+        deny all;
+        return 404;
+    }        
 
 
-        location ~ [^/]\.php(/|$)|^/update.php {
-            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
-            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            fastcgi_param SCRIPT_FILENAME $request_filename;
-            fastcgi_intercept_errors on;
-            include         /etc/nginx/fastcgi_params;
-        }
+    location ~ ^/sites/.*/files/styles/ {
+        try_files $uri @rewrite;
     }
     }
 
 
-    location @rewrite {
-        # You have 2 options here
-        # For D7 and above:
-        # Clean URLs are handled in drupal_environment_initialize().
-        rewrite ^ /index.php;
+    location ~ ^(/[a-z\-]+)?/system/files/ {
+        try_files $uri /index.php?$query_string;
     }
     }
 
 
-    location ~ ^/sites/.*/files/styles/ {
+    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
         try_files $uri @rewrite;
         try_files $uri @rewrite;
+        expires max;
+        log_not_found off;
+    }
+
+    location ~ '\.php$|^/update.php' {
+        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_pass %backend_lsnr%;
+        include         /etc/nginx/fastcgi_params;
     }
     }
 
 
     error_page  403 /error/404.html;
     error_page  403 /error/404.html;

+ 1 - 0
install/ubuntu/14.10/nginx/nginx.conf

@@ -50,6 +50,7 @@ http {
 
 
     # Compression
     # Compression
     gzip                on;
     gzip                on;
+    gzip_vary           on;
     gzip_comp_level     9;
     gzip_comp_level     9;
     gzip_min_length     512;
     gzip_min_length     512;
     gzip_buffers        8 64k;
     gzip_buffers        8 64k;

Неке датотеке нису приказане због велике количине промена