Skip to content

Commit 5c4c53b

Browse files
author
Serghey Rodin
committed
propagated php-fpm templates across all distros
1 parent 6b434d9 commit 5c4c53b

File tree

88 files changed

+3050
-594
lines changed

Some content is hidden

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

88 files changed

+3050
-594
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ server {
3333
rewrite ^/(.+)$ /index.php?_route_=$1 last;
3434
}
3535

36+
location /vstats/ {
37+
alias %home%/%user%/web/%domain%/stats/;
38+
include %home%/%user%/conf/web/%domain%.auth*;
39+
}
40+
3641
error_page 403 /error/404.html;
3742
error_page 404 /error/404.html;
3843
error_page 500 502 503 504 /error/50x.html;

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ server {
2828
rewrite ^/(.+)$ /index.php?_route_=$1 last;
2929
}
3030

31+
location /vstats/ {
32+
alias %home%/%user%/web/%domain%/stats/;
33+
include %home%/%user%/conf/web/%domain%.auth*;
34+
}
35+
3136
error_page 403 /error/404.html;
3237
error_page 404 /error/404.html;
3338
error_page 500 502 503 504 /error/50x.html;

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

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,49 @@
11
server {
2-
listen %ip%:%web_ssl_port%;
2+
listen %ip%:%web_ssl_port% ssl http2;
33
server_name %domain_idn% %alias_idn%;
4-
root %sdocroot%;
4+
ssl_certificate %ssl_pem%;
5+
ssl_certificate_key %ssl_key%;
6+
root %docroot%;
57
index index.php index.html index.htm;
68
access_log /var/log/nginx/domains/%domain%.log combined;
79
access_log /var/log/nginx/domains/%domain%.bytes bytes;
810
error_log /var/log/nginx/domains/%domain%.error.log error;
911

10-
ssl on;
11-
ssl_certificate %ssl_pem%;
12-
ssl_certificate_key %ssl_key%;
12+
location = /favicon.ico {
13+
log_not_found off;
14+
access_log off;
15+
}
1316

14-
if (!-f $request_filename){
15-
rewrite ^/([a-zA-Z0-9-]+)$ /$1.php last;
16-
}
17+
location = /robots.txt {
18+
allow all;
19+
log_not_found off;
20+
access_log off;
21+
}
1722

18-
location / {
19-
index index.php;
23+
location ~* "/\.(htaccess|htpasswd|git|svn|DS_Store)$" {
24+
deny all;
25+
}
26+
27+
location ~ /(readme.html|license.txt) {
28+
deny all;
29+
}
2030

21-
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
22-
expires max;
31+
if (!-f $request_filename){
32+
rewrite ^/([a-zA-Z0-9-]+)$ /$1.php last;
33+
}
34+
35+
location / {
36+
try_files $uri $uri/ /index.php?$args;
37+
location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar|pdf)$ {
38+
expires 1d;
2339
}
2440

2541
location ~ [^/]\.php(/|$) {
2642
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
27-
if (!-f $document_root$fastcgi_script_name) {
28-
return 404;
29-
}
30-
31-
fastcgi_pass %backend_lsnr%;
32-
fastcgi_index index.php;
33-
include /etc/nginx/fastcgi_params;
43+
try_files $uri =404;
44+
fastcgi_pass %backend_lsnr%;
45+
fastcgi_index index.php;
46+
include /etc/nginx/fastcgi_params;
3447
}
3548

3649
location /l/ {
@@ -62,14 +75,14 @@ server {
6275
alias %home%/%user%/web/%domain%/document_errors/;
6376
}
6477

65-
location ~* "/\.(htaccess|htpasswd)$" {
66-
deny all;
67-
return 404;
78+
location /vstats/ {
79+
alias %home%/%user%/web/%domain%/stats/;
80+
include %home%/%user%/web/%domain%/stats/auth.conf*;
6881
}
6982

7083
include /etc/nginx/conf.d/phpmyadmin.inc*;
7184
include /etc/nginx/conf.d/phppgadmin.inc*;
7285
include /etc/nginx/conf.d/webmail.inc*;
7386

74-
include %home%/%user%/conf/web/snginx.%domain%.conf*;
87+
include %home%/%user%/conf/web/nginx.%domain%.conf*;
7588
}

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

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,41 @@ server {
77
access_log /var/log/nginx/domains/%domain%.bytes bytes;
88
error_log /var/log/nginx/domains/%domain%.error.log error;
99
10-
if (!-f $request_filename){
11-
rewrite ^/([a-zA-Z0-9-]+)$ /$1.php last;
12-
}
10+
location = /favicon.ico {
11+
log_not_found off;
12+
access_log off;
13+
}
1314

14-
location / {
15-
index index.php;
15+
location = /robots.txt {
16+
allow all;
17+
log_not_found off;
18+
access_log off;
19+
}
20+
21+
location ~* "/\.(htaccess|htpasswd|git|svn|DS_Store)$" {
22+
deny all;
23+
}
1624

17-
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
18-
expires max;
25+
location ~ /(readme.html|license.txt) {
26+
deny all;
27+
}
28+
29+
if (!-f $request_filename){
30+
rewrite ^/([a-zA-Z0-9-]+)$ /$1.php last;
31+
}
32+
33+
location / {
34+
try_files $uri $uri/ /index.php?$args;
35+
location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar|pdf)$ {
36+
expires 1d;
1937
}
2038

2139
location ~ [^/]\.php(/|$) {
2240
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
23-
if (!-f $document_root$fastcgi_script_name) {
24-
return 404;
25-
}
26-
27-
fastcgi_pass %backend_lsnr%;
28-
fastcgi_index index.php;
29-
include /etc/nginx/fastcgi_params;
41+
try_files $uri =404;
42+
fastcgi_pass %backend_lsnr%;
43+
fastcgi_index index.php;
44+
include /etc/nginx/fastcgi_params;
3045
}
3146

3247
location /l/ {
@@ -58,9 +73,9 @@ server {
5873
alias %home%/%user%/web/%domain%/document_errors/;
5974
}
6075

61-
location ~* "/\.(htaccess|htpasswd)$" {
62-
deny all;
63-
return 404;
76+
location /vstats/ {
77+
alias %home%/%user%/web/%domain%/stats/;
78+
include %home%/%user%/web/%domain%/stats/auth.conf*;
6479
}
6580

6681
include /etc/nginx/conf.d/phpmyadmin.inc*;
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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 / {
26+
try_files $uri $uri/ /index.php?$args;
27+
28+
if (!-e $request_filename)
29+
{
30+
rewrite ^(.+)$ /index.php?q=$1 last;
31+
}
32+
33+
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
34+
expires max;
35+
}
36+
37+
location ~ [^/]\.php(/|$) {
38+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
39+
if (!-f $document_root$fastcgi_script_name) {
40+
return 404;
41+
}
42+
43+
fastcgi_pass %backend_lsnr%;
44+
fastcgi_index index.php;
45+
include /etc/nginx/fastcgi_params;
46+
}
47+
}
48+
49+
error_page 403 /error/404.html;
50+
error_page 404 /error/404.html;
51+
error_page 500 502 503 504 /error/50x.html;
52+
53+
location /error/ {
54+
alias %home%/%user%/web/%domain%/document_errors/;
55+
}
56+
57+
location ~* "/\.(htaccess|htpasswd)$" {
58+
deny all;
59+
return 404;
60+
}
61+
62+
location /vstats/ {
63+
alias %home%/%user%/web/%domain%/stats/;
64+
include %home%/%user%/web/%domain%/stats/auth.conf*;
65+
}
66+
67+
include /etc/nginx/conf.d/phpmyadmin.inc*;
68+
include /etc/nginx/conf.d/phppgadmin.inc*;
69+
include /etc/nginx/conf.d/webmail.inc*;
70+
71+
include %home%/%user%/conf/web/nginx.%domain_idn%.conf*;
72+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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+
location = /favicon.ico {
10+
log_not_found off;
11+
access_log off;
12+
}
13+
14+
location = /robots.txt {
15+
allow all;
16+
log_not_found off;
17+
access_log off;
18+
}
19+
20+
location / {
21+
try_files $uri $uri/ /index.php?$args;
22+
23+
if (!-e $request_filename)
24+
{
25+
rewrite ^(.+)$ /index.php?q=$1 last;
26+
}
27+
28+
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
29+
expires max;
30+
}
31+
32+
location ~ [^/]\.php(/|$) {
33+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
34+
if (!-f $document_root$fastcgi_script_name) {
35+
return 404;
36+
}
37+
38+
fastcgi_pass %backend_lsnr%;
39+
fastcgi_index index.php;
40+
include /etc/nginx/fastcgi_params;
41+
}
42+
}
43+
44+
error_page 403 /error/404.html;
45+
error_page 404 /error/404.html;
46+
error_page 500 502 503 504 /error/50x.html;
47+
48+
location /error/ {
49+
alias %home%/%user%/web/%domain%/document_errors/;
50+
}
51+
52+
location ~* "/\.(htaccess|htpasswd)$" {
53+
deny all;
54+
return 404;
55+
}
56+
57+
location /vstats/ {
58+
alias %home%/%user%/web/%domain%/stats/;
59+
include %home%/%user%/web/%domain%/stats/auth.conf*;
60+
}
61+
62+
include /etc/nginx/conf.d/phpmyadmin.inc*;
63+
include /etc/nginx/conf.d/phppgadmin.inc*;
64+
include /etc/nginx/conf.d/webmail.inc*;
65+
66+
include %home%/%user%/conf/web/nginx.%domain_idn%.conf*;
67+
}

install/debian/8/templates/web/nginx/php5-fpm/opencart.stpl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ server {
3333
rewrite ^/(.+)$ /index.php?_route_=$1 last;
3434
}
3535

36+
location /vstats/ {
37+
alias %home%/%user%/web/%domain%/stats/;
38+
include %home%/%user%/conf/web/%domain%.auth*;
39+
}
40+
3641
error_page 403 /error/404.html;
3742
error_page 404 /error/404.html;
3843
error_page 500 502 503 504 /error/50x.html;

install/debian/8/templates/web/nginx/php5-fpm/opencart.tpl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ server {
2828
rewrite ^/(.+)$ /index.php?_route_=$1 last;
2929
}
3030

31+
location /vstats/ {
32+
alias %home%/%user%/web/%domain%/stats/;
33+
include %home%/%user%/conf/web/%domain%.auth*;
34+
}
35+
3136
error_page 403 /error/404.html;
3237
error_page 404 /error/404.html;
3338
error_page 500 502 503 504 /error/50x.html;

0 commit comments

Comments
 (0)