Skip to content

Commit 9f0073a

Browse files
Merge pull request hestiacp#631 from crackerizer/master
Added Drupal 6,7 and Moodle Nginx's templates
2 parents 18b40f3 + 1c3aaa0 commit 9f0073a

File tree

148 files changed

+8846
-1865
lines changed

Some content is hidden

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

148 files changed

+8846
-1865
lines changed

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,10 @@ server {
6565
}
6666

6767
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;
72-
7368
# For Drupal 6 and bwlow:
7469
# Some modules enforce no slash (/) at the end of the URL
7570
# Else this rewrite block wouldn't be needed (GlobalRedirect)
76-
#rewrite ^/(.*)$ /index.php?q=$1;
71+
rewrite ^/(.*)$ /index.php?q=$1;
7772
}
7873

7974
location ~ ^/sites/.*/files/styles/ {

install/rhel/5/templates/web/nginx/php-fpm/drupal.tpl renamed to install/debian/7/templates/web/nginx/php5-fpm/drupal6.tpl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,10 @@ server {
6262
}
6363

6464
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;
69-
7065
# For Drupal 6 and bwlow:
7166
# Some modules enforce no slash (/) at the end of the URL
7267
# Else this rewrite block wouldn't be needed (GlobalRedirect)
73-
#rewrite ^/(.*)$ /index.php?q=$1;
68+
rewrite ^/(.*)$ /index.php?q=$1;
7469
}
7570
7671
location ~ ^/sites/.*/files/styles/ {
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
server {
2+
listen %ip%:%web_ssl_port%;
3+
server_name %domain_idn% %alias_idn%;
4+
root %docroot%;
5+
index index.php index.html index.htm;
6+
access_log /var/log/nginx/domains/%domain%.log combined;
7+
access_log /var/log/nginx/domains/%domain%.bytes bytes;
8+
error_log /var/log/nginx/domains/%domain%.error.log error;
9+
10+
ssl on;
11+
ssl_certificate %ssl_pem%;
12+
ssl_certificate_key %ssl_key%;
13+
14+
location = /favicon.ico {
15+
log_not_found off;
16+
access_log off;
17+
}
18+
19+
location = /robots.txt {
20+
allow all;
21+
log_not_found off;
22+
access_log off;
23+
}
24+
25+
location ~* \.(txt|log)$ {
26+
allow 192.168.0.0/16;
27+
deny all;
28+
}
29+
30+
location ~ \..*/.*\.php$ {
31+
return 403;
32+
}
33+
34+
# No no for private
35+
location ~ ^/sites/.*/private/ {
36+
return 403;
37+
}
38+
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+
46+
location / {
47+
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+
}
65+
}
66+
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;
72+
}
73+
74+
location ~ ^/sites/.*/files/styles/ {
75+
try_files $uri @rewrite;
76+
}
77+
78+
error_page 403 /error/404.html;
79+
error_page 404 /error/404.html;
80+
error_page 500 502 503 504 /error/50x.html;
81+
82+
location /error/ {
83+
alias %home%/%user%/web/%domain%/document_errors/;
84+
}
85+
86+
location ~* "/\.(htaccess|htpasswd)$" {
87+
deny all;
88+
return 404;
89+
}
90+
91+
include /etc/nginx/conf.d/phpmyadmin.inc*;
92+
include /etc/nginx/conf.d/phppgadmin.inc*;
93+
include /etc/nginx/conf.d/webmail.inc*;
94+
95+
include %home%/%user%/conf/web/nginx.%domain%.conf*;
96+
}
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
server {
2+
listen %ip%:%web_port%;
3+
server_name %domain_idn% %alias_idn%;
4+
root %docroot%;
5+
index index.php index.html index.htm;
6+
access_log /var/log/nginx/domains/%domain%.log combined;
7+
access_log /var/log/nginx/domains/%domain%.bytes bytes;
8+
error_log /var/log/nginx/domains/%domain%.error.log error;
9+
10+
location = /favicon.ico {
11+
log_not_found off;
12+
access_log off;
13+
}
14+
15+
location = /robots.txt {
16+
allow all;
17+
log_not_found off;
18+
access_log off;
19+
}
20+
21+
# Very rarely should these ever be accessed outside of your lan
22+
location ~* \.(txt|log)$ {
23+
allow 192.168.0.0/16;
24+
deny all;
25+
}
26+
27+
location ~ \..*/.*\.php$ {
28+
return 403;
29+
}
30+
31+
# No no for private
32+
location ~ ^/sites/.*/private/ {
33+
return 403;
34+
}
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;
41+
}
42+
43+
location / {
44+
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+
}
62+
}
63+
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;
69+
}
70+
71+
location ~ ^/sites/.*/files/styles/ {
72+
try_files $uri @rewrite;
73+
}
74+
75+
error_page 403 /error/404.html;
76+
error_page 404 /error/404.html;
77+
error_page 500 502 503 504 /error/50x.html;
78+
79+
location /error/ {
80+
alias %home%/%user%/web/%domain%/document_errors/;
81+
}
82+
83+
location ~* "/\.(htaccess|htpasswd)$" {
84+
deny all;
85+
return 404;
86+
}
87+
88+
include /etc/nginx/conf.d/phpmyadmin.inc*;
89+
include /etc/nginx/conf.d/phppgadmin.inc*;
90+
include /etc/nginx/conf.d/webmail.inc*;
91+
92+
include %home%/%user%/conf/web/nginx.%domain%.conf*;
93+
}
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
server {
2+
listen %ip%:%web_ssl_port%;
3+
server_name %domain_idn% %alias_idn%;
4+
root %docroot%;
5+
index index.php index.html index.htm;
6+
access_log /var/log/nginx/domains/%domain%.log combined;
7+
access_log /var/log/nginx/domains/%domain%.bytes bytes;
8+
error_log /var/log/nginx/domains/%domain%.error.log error;
9+
10+
ssl on;
11+
ssl_certificate %ssl_pem%;
12+
ssl_certificate_key %ssl_key%;
13+
14+
location = /favicon.ico {
15+
log_not_found off;
16+
access_log off;
17+
}
18+
19+
location = /robots.txt {
20+
allow all;
21+
log_not_found off;
22+
access_log off;
23+
}
24+
25+
location ~* \.(txt|log)$ {
26+
allow 192.168.0.0/16;
27+
deny all;
28+
}
29+
30+
location ~ \..*/.*\.php$ {
31+
return 403;
32+
}
33+
34+
# No no for private
35+
location ~ ^/sites/.*/private/ {
36+
return 403;
37+
}
38+
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+
46+
location / {
47+
try_files $uri @rewrite;
48+
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+
}
66+
}
67+
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;
73+
}
74+
75+
location ~ ^/sites/.*/files/styles/ {
76+
try_files $uri @rewrite;
77+
}
78+
79+
error_page 403 /error/404.html;
80+
error_page 404 /error/404.html;
81+
error_page 500 502 503 504 /error/50x.html;
82+
83+
location /error/ {
84+
alias %home%/%user%/web/%domain%/document_errors/;
85+
}
86+
87+
location ~* "/\.(htaccess|htpasswd)$" {
88+
deny all;
89+
return 404;
90+
}
91+
92+
include /etc/nginx/conf.d/phpmyadmin.inc*;
93+
include /etc/nginx/conf.d/phppgadmin.inc*;
94+
include /etc/nginx/conf.d/webmail.inc*;
95+
96+
include %home%/%user%/conf/web/nginx.%domain%.conf*;
97+
}

0 commit comments

Comments
 (0)