Skip to content

Commit 6a34f06

Browse files
author
Serghey Rodin
committed
Merge branch 'master' of github.com:serghey-rodin/vesta
2 parents 1c315de + fbe93aa commit 6a34f06

File tree

114 files changed

+2698
-3477
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+2698
-3477
lines changed

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

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -31,48 +31,42 @@ server {
3131
return 403;
3232
}
3333

34-
# No no for private
3534
location ~ ^/sites/.*/private/ {
3635
return 403;
3736
}
3837

39-
# Block access to "hidden" files and directories whose names begin with a
40-
# period. This includes directories used by version control systems such
41-
# as Subversion or Git to store control files.
42-
location ~ (^|/)\. {
43-
return 403;
44-
}
45-
38+
location ~ ^/sites/[^/]+/files/.*\.php$ {
39+
deny all;
40+
}
41+
4642
location / {
4743
try_files $uri @rewrite;
48-
49-
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
50-
expires max;
51-
}
52-
53-
location ~ [^/]\.php(/|$) {
54-
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
55-
if (!-f $document_root$fastcgi_script_name) {
56-
return 404;
57-
}
58-
59-
fastcgi_pass %backend_lsnr%;
60-
fastcgi_index index.php;
61-
fastcgi_param SCRIPT_FILENAME $request_filename;
62-
fastcgi_intercept_errors on;
63-
include /etc/nginx/fastcgi_params;
64-
}
6544
}
6645

6746
location @rewrite {
68-
# For Drupal 6 and bwlow:
69-
# Some modules enforce no slash (/) at the end of the URL
70-
# Else this rewrite block wouldn't be needed (GlobalRedirect)
7147
rewrite ^/(.*)$ /index.php?q=$1;
7248
}
49+
50+
location ~ /vendor/.*\.php$ {
51+
deny all;
52+
return 404;
53+
}
54+
55+
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
56+
try_files $uri @rewrite;
57+
expires max;
58+
log_not_found off;
59+
}
7360

74-
location ~ ^/sites/.*/files/styles/ {
61+
location ~ ^/sites/.*/files/imagecache/ {
7562
try_files $uri @rewrite;
63+
}
64+
65+
location ~ '\.php$|^/update.php' {
66+
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
67+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
68+
fastcgi_pass %backend_lsnr%;
69+
include /etc/nginx/fastcgi_params;
7670
}
7771

7872
error_page 403 /error/404.html;

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

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ server {
1818
access_log off;
1919
}
2020

21-
# Very rarely should these ever be accessed outside of your lan
2221
location ~* \.(txt|log)$ {
2322
allow 192.168.0.0/16;
2423
deny all;
@@ -28,49 +27,43 @@ server {
2827
return 403;
2928
}
3029

31-
# No no for private
3230
location ~ ^/sites/.*/private/ {
3331
return 403;
3432
}
3533

36-
# Block access to "hidden" files and directories whose names begin with a
37-
# period. This includes directories used by version control systems such
38-
# as Subversion or Git to store control files.
39-
location ~ (^|/)\. {
40-
return 403;
34+
location ~ ^/sites/[^/]+/files/.*\.php$ {
35+
deny all;
4136
}
4237

4338
location / {
4439
try_files $uri @rewrite;
45-
46-
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
47-
expires max;
48-
}
49-
50-
location ~ [^/]\.php(/|$) {
51-
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
52-
if (!-f $document_root$fastcgi_script_name) {
53-
return 404;
54-
}
55-
56-
fastcgi_pass %backend_lsnr%;
57-
fastcgi_index index.php;
58-
fastcgi_param SCRIPT_FILENAME $request_filename;
59-
fastcgi_intercept_errors on;
60-
include /etc/nginx/fastcgi_params;
61-
}
6240
}
6341

6442
location @rewrite {
65-
# For Drupal 6 and bwlow:
66-
# Some modules enforce no slash (/) at the end of the URL
67-
# Else this rewrite block wouldn't be needed (GlobalRedirect)
6843
rewrite ^/(.*)$ /index.php?q=$1;
6944
}
45+
46+
location ~ /vendor/.*\.php$ {
47+
deny all;
48+
return 404;
49+
}
50+
51+
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
52+
try_files $uri @rewrite;
53+
expires max;
54+
log_not_found off;
55+
}
7056

71-
location ~ ^/sites/.*/files/styles/ {
57+
location ~ ^/sites/.*/files/imagecache/ {
7258
try_files $uri @rewrite;
7359
}
60+
61+
location ~ '\.php$|^/update.php' {
62+
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
63+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
64+
fastcgi_pass %backend_lsnr%;
65+
include /etc/nginx/fastcgi_params;
66+
}
7467

7568
error_page 403 /error/404.html;
7669
error_page 404 /error/404.html;

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

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -31,48 +31,42 @@ server {
3131
return 403;
3232
}
3333

34-
# No no for private
3534
location ~ ^/sites/.*/private/ {
3635
return 403;
3736
}
3837

39-
# Block access to "hidden" files and directories whose names begin with a
40-
# period. This includes directories used by version control systems such
41-
# as Subversion or Git to store control files.
42-
location ~ (^|/)\. {
43-
return 403;
44-
}
45-
38+
location ~ ^/sites/[^/]+/files/.*\.php$ {
39+
deny all;
40+
}
41+
4642
location / {
47-
try_files $uri @rewrite;
43+
try_files $uri /index.php?$query_string;
44+
}
45+
46+
location ~ /vendor/.*\.php$ {
47+
deny all;
48+
return 404;
49+
}
4850

49-
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
50-
expires max;
51-
}
52-
53-
location ~ [^/]\.php(/|$) {
54-
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
55-
if (!-f $document_root$fastcgi_script_name) {
56-
return 404;
57-
}
58-
59-
fastcgi_pass %backend_lsnr%;
60-
fastcgi_index index.php;
61-
fastcgi_param SCRIPT_FILENAME $request_filename;
62-
fastcgi_intercept_errors on;
63-
include /etc/nginx/fastcgi_params;
64-
}
51+
location ~ ^/sites/.*/files/styles/ {
52+
try_files $uri @rewrite;
6553
}
6654

67-
location @rewrite {
68-
# You have 2 options here
69-
# For D7 and above:
70-
# Clean URLs are handled in drupal_environment_initialize().
71-
rewrite ^ /index.php;
55+
location ~ ^(/[a-z\-]+)?/system/files/ {
56+
try_files $uri /index.php?$query_string;
7257
}
7358

74-
location ~ ^/sites/.*/files/styles/ {
59+
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
7560
try_files $uri @rewrite;
61+
expires max;
62+
log_not_found off;
63+
}
64+
65+
location ~ '\.php$|^/update.php' {
66+
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
67+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
68+
fastcgi_pass %backend_lsnr%;
69+
include /etc/nginx/fastcgi_params;
7670
}
7771

7872
error_page 403 /error/404.html;

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

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ server {
1818
access_log off;
1919
}
2020

21-
# Very rarely should these ever be accessed outside of your lan
2221
location ~* \.(txt|log)$ {
2322
allow 192.168.0.0/16;
2423
deny all;
@@ -28,48 +27,42 @@ server {
2827
return 403;
2928
}
3029

31-
# No no for private
3230
location ~ ^/sites/.*/private/ {
3331
return 403;
3432
}
35-
36-
# Block access to "hidden" files and directories whose names begin with a
37-
# period. This includes directories used by version control systems such
38-
# as Subversion or Git to store control files.
39-
location ~ (^|/)\. {
40-
return 403;
33+
34+
location ~ ^/sites/[^/]+/files/.*\.php$ {
35+
deny all;
4136
}
42-
37+
4338
location / {
44-
try_files $uri @rewrite;
39+
try_files $uri /index.php?$query_string;
40+
}
4541

46-
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
47-
expires max;
48-
}
42+
location ~ /vendor/.*\.php$ {
43+
deny all;
44+
return 404;
45+
}
4946

50-
location ~ [^/]\.php(/|$) {
51-
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
52-
if (!-f $document_root$fastcgi_script_name) {
53-
return 404;
54-
}
55-
56-
fastcgi_pass %backend_lsnr%;
57-
fastcgi_index index.php;
58-
fastcgi_param SCRIPT_FILENAME $request_filename;
59-
fastcgi_intercept_errors on;
60-
include /etc/nginx/fastcgi_params;
61-
}
47+
location ~ ^/sites/.*/files/styles/ {
48+
try_files $uri @rewrite;
6249
}
6350

64-
location @rewrite {
65-
# You have 2 options here
66-
# For D7 and above:
67-
# Clean URLs are handled in drupal_environment_initialize().
68-
rewrite ^ /index.php;
51+
location ~ ^(/[a-z\-]+)?/system/files/ {
52+
try_files $uri /index.php?$query_string;
6953
}
7054

71-
location ~ ^/sites/.*/files/styles/ {
55+
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
7256
try_files $uri @rewrite;
57+
expires max;
58+
log_not_found off;
59+
}
60+
61+
location ~ '\.php$|^/update.php' {
62+
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
63+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
64+
fastcgi_pass %backend_lsnr%;
65+
include /etc/nginx/fastcgi_params;
7366
}
7467

7568
error_page 403 /error/404.html;

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

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -31,49 +31,42 @@ server {
3131
return 403;
3232
}
3333

34-
# No no for private
3534
location ~ ^/sites/.*/private/ {
3635
return 403;
3736
}
3837

39-
# Block access to "hidden" files and directories whose names begin with a
40-
# period. This includes directories used by version control systems such
41-
# as Subversion or Git to store control files.
42-
location ~ (^|/)\. {
43-
return 403;
44-
}
45-
38+
location ~ ^/sites/[^/]+/files/.*\.php$ {
39+
deny all;
40+
}
41+
4642
location / {
47-
try_files $uri @rewrite;
43+
try_files $uri /index.php?$query_string;
44+
}
45+
46+
location ~ /vendor/.*\.php$ {
47+
deny all;
48+
return 404;
49+
}
4850

49-
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
50-
expires max;
51-
}
52-
53-
location ~ [^/]\.php(/|$)|^/update.php {
54-
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
55-
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
56-
if (!-f $document_root$fastcgi_script_name) {
57-
return 404;
58-
}
59-
60-
fastcgi_pass %backend_lsnr%;
61-
fastcgi_index index.php;
62-
fastcgi_param SCRIPT_FILENAME $request_filename;
63-
fastcgi_intercept_errors on;
64-
include /etc/nginx/fastcgi_params;
65-
}
51+
location ~ ^/sites/.*/files/styles/ {
52+
try_files $uri @rewrite;
6653
}
6754

68-
location @rewrite {
69-
# You have 2 options here
70-
# For D7 and above:
71-
# Clean URLs are handled in drupal_environment_initialize().
72-
rewrite ^ /index.php;
55+
location ~ ^(/[a-z\-]+)?/system/files/ {
56+
try_files $uri /index.php?$query_string;
7357
}
7458

75-
location ~ ^/sites/.*/files/styles/ {
59+
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
7660
try_files $uri @rewrite;
61+
expires max;
62+
log_not_found off;
63+
}
64+
65+
location ~ '\.php$|^/update.php' {
66+
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
67+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
68+
fastcgi_pass %backend_lsnr%;
69+
include /etc/nginx/fastcgi_params;
7770
}
7871

7972
error_page 403 /error/404.html;

0 commit comments

Comments
 (0)