Skip to content

Commit e7f8a35

Browse files
authored
Merge pull request hestiacp#1973 from anvme/main
[New] Craft CMS templates
2 parents 2c05926 + a62b49b commit e7f8a35

File tree

4 files changed

+291
-0
lines changed

4 files changed

+291
-0
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#=======================================================================#
2+
# Default Web Domain Template #
3+
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
4+
#=======================================================================#
5+
6+
server {
7+
listen %ip%:%web_ssl_port% ssl http2;
8+
server_name %domain_idn% %alias_idn%;
9+
root %sdocroot%/web;
10+
index index.php index.html index.htm;
11+
access_log /var/log/nginx/domains/%domain%.log combined;
12+
access_log /var/log/nginx/domains/%domain%.bytes bytes;
13+
error_log /var/log/nginx/domains/%domain%.error.log error;
14+
15+
ssl_certificate %ssl_pem%;
16+
ssl_certificate_key %ssl_key%;
17+
ssl_stapling on;
18+
ssl_stapling_verify on;
19+
20+
include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
21+
22+
location = /favicon.ico {
23+
log_not_found off;
24+
access_log off;
25+
}
26+
27+
location = /robots.txt {
28+
allow all;
29+
log_not_found off;
30+
access_log off;
31+
}
32+
33+
location ~ /\.(?!well-known\/) {
34+
deny all;
35+
return 404;
36+
}
37+
38+
# Craft-specific location handlers to ensure AdminCP requests route through index.php
39+
# If you change your `cpTrigger`, change it here as well
40+
location ^~ /admin {
41+
try_files $uri $uri/ @phpfpm_nocache;
42+
}
43+
location ^~ /index.php/admin {
44+
try_files $uri $uri/ @phpfpm_nocache;
45+
}
46+
location ^~ /cpresources {
47+
try_files $uri $uri/ /index.php?$query_string;
48+
}
49+
location ^~ /actions {
50+
try_files $uri $uri/ /index.php?$query_string;
51+
}
52+
53+
location / {
54+
try_files $uri $uri/ /index.php?$args;
55+
location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
56+
expires 30d;
57+
fastcgi_hide_header "Set-Cookie";
58+
}
59+
60+
location ~ [^/]\.php(/|$) {
61+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
62+
try_files $uri =404;
63+
fastcgi_pass %backend_lsnr%;
64+
fastcgi_index index.php;
65+
include /etc/nginx/fastcgi_params;
66+
include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
67+
}
68+
}
69+
70+
location /error/ {
71+
alias %home%/%user%/web/%domain%/document_errors/;
72+
}
73+
74+
location /vstats/ {
75+
alias %home%/%user%/web/%domain%/stats/;
76+
include %home%/%user%/web/%domain%/stats/auth.conf*;
77+
}
78+
79+
include /etc/nginx/conf.d/phpmyadmin.inc*;
80+
include /etc/nginx/conf.d/phppgadmin.inc*;
81+
include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
82+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#=======================================================================#
2+
# Default Web Domain Template #
3+
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
4+
#=======================================================================#
5+
6+
server {
7+
listen %ip%:%web_port%;
8+
server_name %domain_idn% %alias_idn%;
9+
root %docroot%/web;
10+
index index.php index.html index.htm;
11+
access_log /var/log/nginx/domains/%domain%.log combined;
12+
access_log /var/log/nginx/domains/%domain%.bytes bytes;
13+
error_log /var/log/nginx/domains/%domain%.error.log error;
14+
15+
include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
16+
17+
location = /favicon.ico {
18+
log_not_found off;
19+
access_log off;
20+
}
21+
22+
location = /robots.txt {
23+
allow all;
24+
log_not_found off;
25+
access_log off;
26+
}
27+
28+
location ~ /\.(?!well-known\/) {
29+
deny all;
30+
return 404;
31+
}
32+
33+
# Craft-specific location handlers to ensure AdminCP requests route through index.php
34+
# If you change your `cpTrigger`, change it here as well
35+
location ^~ /admin {
36+
try_files $uri $uri/ @phpfpm_nocache;
37+
}
38+
location ^~ /index.php/admin {
39+
try_files $uri $uri/ @phpfpm_nocache;
40+
}
41+
location ^~ /cpresources {
42+
try_files $uri $uri/ /index.php?$query_string;
43+
}
44+
location ^~ /actions {
45+
try_files $uri $uri/ /index.php?$query_string;
46+
}
47+
48+
location / {
49+
try_files $uri $uri/ /index.php?$args;
50+
location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
51+
expires 30d;
52+
fastcgi_hide_header "Set-Cookie";
53+
}
54+
55+
location ~ [^/]\.php(/|$) {
56+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
57+
try_files $uri =404;
58+
fastcgi_pass %backend_lsnr%;
59+
fastcgi_index index.php;
60+
include /etc/nginx/fastcgi_params;
61+
include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
62+
63+
}
64+
}
65+
66+
location /error/ {
67+
alias %home%/%user%/web/%domain%/document_errors/;
68+
}
69+
70+
location /vstats/ {
71+
alias %home%/%user%/web/%domain%/stats/;
72+
include %home%/%user%/web/%domain%/stats/auth.conf*;
73+
}
74+
75+
include /etc/nginx/conf.d/phpmyadmin.inc*;
76+
include /etc/nginx/conf.d/phppgadmin.inc*;
77+
include %home%/%user%/conf/web/%domain%/nginx.conf_*;
78+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
server {
2+
listen %ip%:%web_ssl_port% ssl http2;
3+
server_name %domain_idn% %alias_idn%;
4+
root %sdocroot%/web;
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_certificate %ssl_pem%;
11+
ssl_certificate_key %ssl_key%;
12+
ssl_stapling on;
13+
ssl_stapling_verify on;
14+
15+
include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
16+
17+
# Craft-specific location handlers to ensure AdminCP requests route through index.php
18+
# If you change your `cpTrigger`, change it here as well
19+
location ^~ /admin {
20+
try_files $uri $uri/ @phpfpm_nocache;
21+
}
22+
location ^~ /index.php/admin {
23+
try_files $uri $uri/ @phpfpm_nocache;
24+
}
25+
location ^~ /cpresources {
26+
try_files $uri $uri/ /index.php?$query_string;
27+
}
28+
location ^~ /actions {
29+
try_files $uri $uri/ /index.php?$query_string;
30+
}
31+
32+
location / {
33+
try_files $uri $uri/ /index.php?$query_string;
34+
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js|webp)$ {
35+
expires max;
36+
fastcgi_hide_header "Set-Cookie";
37+
}
38+
39+
location ~ [^/]\.php(/|$) {
40+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
41+
if (!-f $document_root$fastcgi_script_name) {
42+
return 404;
43+
}
44+
45+
fastcgi_pass %backend_lsnr%;
46+
fastcgi_index index.php;
47+
include /etc/nginx/fastcgi_params;
48+
}
49+
}
50+
51+
location /error/ {
52+
alias %home%/%user%/web/%domain%/document_errors/;
53+
}
54+
55+
location ~* "/\.(htaccess|htpasswd)$" {
56+
deny all;
57+
return 404;
58+
}
59+
60+
location /vstats/ {
61+
alias %home%/%user%/web/%domain%/stats/;
62+
include %home%/%user%/web/%domain%/stats/auth.conf*;
63+
}
64+
65+
include /etc/nginx/conf.d/phpmyadmin.inc*;
66+
include /etc/nginx/conf.d/phppgadmin.inc*;
67+
include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
68+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
server {
2+
listen %ip%:%web_port%;
3+
server_name %domain_idn% %alias_idn%;
4+
root %docroot%/web;
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+
include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
11+
12+
# Craft-specific location handlers to ensure AdminCP requests route through index.php
13+
# If you change your `cpTrigger`, change it here as well
14+
location ^~ /admin {
15+
try_files $uri $uri/ @phpfpm_nocache;
16+
}
17+
location ^~ /index.php/admin {
18+
try_files $uri $uri/ @phpfpm_nocache;
19+
}
20+
location ^~ /cpresources {
21+
try_files $uri $uri/ /index.php?$query_string;
22+
}
23+
location ^~ /actions {
24+
try_files $uri $uri/ /index.php?$query_string;
25+
}
26+
27+
location / {
28+
try_files $uri $uri/ /index.php?$query_string;
29+
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js|webp)$ {
30+
expires max;
31+
fastcgi_hide_header "Set-Cookie";
32+
}
33+
34+
location ~ [^/]\.php(/|$) {
35+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
36+
if (!-f $document_root$fastcgi_script_name) {
37+
return 404;
38+
}
39+
40+
fastcgi_pass %backend_lsnr%;
41+
fastcgi_index index.php;
42+
include /etc/nginx/fastcgi_params;
43+
}
44+
}
45+
46+
location /error/ {
47+
alias %home%/%user%/web/%domain%/document_errors/;
48+
}
49+
50+
location ~* "/\.(htaccess|htpasswd)$" {
51+
deny all;
52+
return 404;
53+
}
54+
55+
location /vstats/ {
56+
alias %home%/%user%/web/%domain%/stats/;
57+
include %home%/%user%/web/%domain%/stats/auth.conf*;
58+
}
59+
60+
include /etc/nginx/conf.d/phpmyadmin.inc*;
61+
include /etc/nginx/conf.d/phppgadmin.inc*;
62+
include %home%/%user%/conf/web/%domain%/nginx.conf_*;
63+
}

0 commit comments

Comments
 (0)