Skip to content

Commit b214401

Browse files
author
Serghey Rodin
committed
Merge branch 'master' of github.com:serghey-rodin/vesta
2 parents 757e065 + 0a934d9 commit b214401

File tree

31 files changed

+1518
-22
lines changed

31 files changed

+1518
-22
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
server {
2+
listen %ip%:%web_ssl_port%;
3+
server_name %domain_idn% %alias_idn%;
4+
root %sdocroot%;
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 / {
15+
try_files $uri $uri/ @opencart;
16+
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
17+
expires max;
18+
}
19+
20+
location ~ [^/]\.php(/|$) {
21+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
22+
if (!-f $document_root$fastcgi_script_name) {
23+
return 404;
24+
}
25+
26+
fastcgi_pass %backend_lsnr%;
27+
fastcgi_index index.php;
28+
include /etc/nginx/fastcgi_params;
29+
}
30+
}
31+
32+
location @opencart {
33+
rewrite ^/(.+)$ /index.php?_route_=$1 last;
34+
}
35+
36+
error_page 403 /error/404.html;
37+
error_page 404 /error/404.html;
38+
error_page 500 502 503 504 /error/50x.html;
39+
40+
location /error/ {
41+
alias %home%/%user%/web/%domain%/document_errors/;
42+
}
43+
44+
location ~* "/\.(htaccess|htpasswd)$" {
45+
deny all;
46+
return 404;
47+
}
48+
49+
include /etc/nginx/conf.d/phpmyadmin.inc*;
50+
include /etc/nginx/conf.d/phppgadmin.inc*;
51+
include /etc/nginx/conf.d/webmail.inc*;
52+
53+
include %home%/%user%/conf/web/snginx.%domain%.conf*;
54+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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 / {
10+
try_files $uri $uri/ @opencart;
11+
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
12+
expires max;
13+
}
14+
15+
location ~ [^/]\.php(/|$) {
16+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
17+
if (!-f $document_root$fastcgi_script_name) {
18+
return 404;
19+
}
20+
21+
fastcgi_pass %backend_lsnr%;
22+
fastcgi_index index.php;
23+
include /etc/nginx/fastcgi_params;
24+
}
25+
}
26+
27+
location @opencart {
28+
rewrite ^/(.+)$ /index.php?_route_=$1 last;
29+
}
30+
31+
error_page 403 /error/404.html;
32+
error_page 404 /error/404.html;
33+
error_page 500 502 503 504 /error/50x.html;
34+
35+
location /error/ {
36+
alias %home%/%user%/web/%domain%/document_errors/;
37+
}
38+
39+
location ~* "/\.(htaccess|htpasswd)$" {
40+
deny all;
41+
return 404;
42+
}
43+
44+
include /etc/nginx/conf.d/phpmyadmin.inc*;
45+
include /etc/nginx/conf.d/phppgadmin.inc*;
46+
include /etc/nginx/conf.d/webmail.inc*;
47+
48+
include %home%/%user%/conf/web/nginx.%domain_idn%.conf*;
49+
}

install/debian/8/nginx/nginx.conf

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
user www-data;
33
worker_processes auto;
44
worker_rlimit_nofile 65535;
5+
timer_resolution 50ms; #In order to free some CPU cycles
56
error_log /var/log/nginx/error.log crit;
67
pid /var/run/nginx.pid;
78

@@ -70,25 +71,27 @@ http {
7071

7172

7273
# Cloudflare https://www.cloudflare.com/ips
73-
set_real_ip_from 199.27.128.0/21;
74-
set_real_ip_from 173.245.48.0/20;
75-
set_real_ip_from 103.21.244.0/22;
76-
set_real_ip_from 103.22.200.0/22;
77-
set_real_ip_from 103.31.4.0/22;
78-
set_real_ip_from 141.101.64.0/18;
79-
set_real_ip_from 108.162.192.0/18;
80-
set_real_ip_from 190.93.240.0/20;
81-
set_real_ip_from 188.114.96.0/20;
82-
set_real_ip_from 197.234.240.0/22;
83-
set_real_ip_from 198.41.128.0/17;
84-
set_real_ip_from 162.158.0.0/15;
85-
set_real_ip_from 104.16.0.0/12;
86-
set_real_ip_from 172.64.0.0/13;
87-
#set_real_ip_from 2400:cb00::/32;
88-
#set_real_ip_from 2606:4700::/32;
89-
#set_real_ip_from 2803:f800::/32;
90-
#set_real_ip_from 2405:b500::/32;
91-
#set_real_ip_from 2405:8100::/32;
74+
set_real_ip_from 103.21.244.0/22;
75+
set_real_ip_from 103.22.200.0/22;
76+
set_real_ip_from 103.31.4.0/22;
77+
set_real_ip_from 104.16.0.0/12;
78+
set_real_ip_from 108.162.192.0/18;
79+
set_real_ip_from 131.0.72.0/22;
80+
set_real_ip_from 141.101.64.0/18;
81+
set_real_ip_from 162.158.0.0/15;
82+
set_real_ip_from 172.64.0.0/13;
83+
set_real_ip_from 173.245.48.0/20;
84+
set_real_ip_from 188.114.96.0/20;
85+
set_real_ip_from 190.93.240.0/20;
86+
set_real_ip_from 197.234.240.0/22;
87+
set_real_ip_from 198.41.128.0/17;
88+
set_real_ip_from 2400:cb00::/32;
89+
set_real_ip_from 2606:4700::/32;
90+
set_real_ip_from 2803:f800::/32;
91+
set_real_ip_from 2405:b500::/32;
92+
set_real_ip_from 2405:8100::/32;
93+
set_real_ip_from 2c0f:f248::/32;
94+
set_real_ip_from 2a06:98c0::/29;
9295
real_ip_header CF-Connecting-IP;
9396

9497

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
server {
2+
listen %ip%:%web_ssl_port%;
3+
server_name %domain_idn% %alias_idn%;
4+
root %sdocroot%;
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 / {
15+
try_files $uri $uri/ @opencart;
16+
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
17+
expires max;
18+
}
19+
20+
location ~ [^/]\.php(/|$) {
21+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
22+
if (!-f $document_root$fastcgi_script_name) {
23+
return 404;
24+
}
25+
26+
fastcgi_pass %backend_lsnr%;
27+
fastcgi_index index.php;
28+
include /etc/nginx/fastcgi_params;
29+
}
30+
}
31+
32+
location @opencart {
33+
rewrite ^/(.+)$ /index.php?_route_=$1 last;
34+
}
35+
36+
error_page 403 /error/404.html;
37+
error_page 404 /error/404.html;
38+
error_page 500 502 503 504 /error/50x.html;
39+
40+
location /error/ {
41+
alias %home%/%user%/web/%domain%/document_errors/;
42+
}
43+
44+
location ~* "/\.(htaccess|htpasswd)$" {
45+
deny all;
46+
return 404;
47+
}
48+
49+
include /etc/nginx/conf.d/phpmyadmin.inc*;
50+
include /etc/nginx/conf.d/phppgadmin.inc*;
51+
include /etc/nginx/conf.d/webmail.inc*;
52+
53+
include %home%/%user%/conf/web/snginx.%domain%.conf*;
54+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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 / {
10+
try_files $uri $uri/ @opencart;
11+
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
12+
expires max;
13+
}
14+
15+
location ~ [^/]\.php(/|$) {
16+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
17+
if (!-f $document_root$fastcgi_script_name) {
18+
return 404;
19+
}
20+
21+
fastcgi_pass %backend_lsnr%;
22+
fastcgi_index index.php;
23+
include /etc/nginx/fastcgi_params;
24+
}
25+
}
26+
27+
location @opencart {
28+
rewrite ^/(.+)$ /index.php?_route_=$1 last;
29+
}
30+
31+
error_page 403 /error/404.html;
32+
error_page 404 /error/404.html;
33+
error_page 500 502 503 504 /error/50x.html;
34+
35+
location /error/ {
36+
alias %home%/%user%/web/%domain%/document_errors/;
37+
}
38+
39+
location ~* "/\.(htaccess|htpasswd)$" {
40+
deny all;
41+
return 404;
42+
}
43+
44+
include /etc/nginx/conf.d/phpmyadmin.inc*;
45+
include /etc/nginx/conf.d/phppgadmin.inc*;
46+
include /etc/nginx/conf.d/webmail.inc*;
47+
48+
include %home%/%user%/conf/web/nginx.%domain_idn%.conf*;
49+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
server {
2+
listen %ip%:%web_ssl_port%;
3+
server_name %domain_idn% %alias_idn%;
4+
root %sdocroot%;
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 / {
15+
try_files $uri $uri/ @opencart;
16+
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
17+
expires max;
18+
}
19+
20+
location ~ [^/]\.php(/|$) {
21+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
22+
if (!-f $document_root$fastcgi_script_name) {
23+
return 404;
24+
}
25+
26+
fastcgi_pass %backend_lsnr%;
27+
fastcgi_index index.php;
28+
include /etc/nginx/fastcgi_params;
29+
}
30+
}
31+
32+
location @opencart {
33+
rewrite ^/(.+)$ /index.php?_route_=$1 last;
34+
}
35+
36+
error_page 403 /error/404.html;
37+
error_page 404 /error/404.html;
38+
error_page 500 502 503 504 /error/50x.html;
39+
40+
location /error/ {
41+
alias %home%/%user%/web/%domain%/document_errors/;
42+
}
43+
44+
location ~* "/\.(htaccess|htpasswd)$" {
45+
deny all;
46+
return 404;
47+
}
48+
49+
include /etc/nginx/conf.d/phpmyadmin.inc*;
50+
include /etc/nginx/conf.d/phppgadmin.inc*;
51+
include /etc/nginx/conf.d/webmail.inc*;
52+
53+
include %home%/%user%/conf/web/snginx.%domain%.conf*;
54+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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 / {
10+
try_files $uri $uri/ @opencart;
11+
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
12+
expires max;
13+
}
14+
15+
location ~ [^/]\.php(/|$) {
16+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
17+
if (!-f $document_root$fastcgi_script_name) {
18+
return 404;
19+
}
20+
21+
fastcgi_pass %backend_lsnr%;
22+
fastcgi_index index.php;
23+
include /etc/nginx/fastcgi_params;
24+
}
25+
}
26+
27+
location @opencart {
28+
rewrite ^/(.+)$ /index.php?_route_=$1 last;
29+
}
30+
31+
error_page 403 /error/404.html;
32+
error_page 404 /error/404.html;
33+
error_page 500 502 503 504 /error/50x.html;
34+
35+
location /error/ {
36+
alias %home%/%user%/web/%domain%/document_errors/;
37+
}
38+
39+
location ~* "/\.(htaccess|htpasswd)$" {
40+
deny all;
41+
return 404;
42+
}
43+
44+
include /etc/nginx/conf.d/phpmyadmin.inc*;
45+
include /etc/nginx/conf.d/phppgadmin.inc*;
46+
include /etc/nginx/conf.d/webmail.inc*;
47+
48+
include %home%/%user%/conf/web/nginx.%domain_idn%.conf*;
49+
}

0 commit comments

Comments
 (0)