Skip to content

Commit 3dfdde3

Browse files
authored
Add web templates for forgejo and opengist web apps (hestiacp#4073)
1 parent 3eb4c8b commit 3dfdde3

File tree

8 files changed

+448
-0
lines changed

8 files changed

+448
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#=========================================================================#
2+
# Default Web Domain Template #
3+
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
4+
# https://hestiacp.com/docs/server-administration/web-templates.html #
5+
#=========================================================================#
6+
7+
server {
8+
listen %ip%:%web_ssl_port% ssl;
9+
server_name %domain_idn% %alias_idn%;
10+
root %sdocroot%;
11+
index index.php index.html index.htm;
12+
access_log /var/log/nginx/domains/%domain%.log combined;
13+
access_log /var/log/nginx/domains/%domain%.bytes bytes;
14+
error_log /var/log/nginx/domains/%domain%.error.log error;
15+
16+
ssl_certificate %ssl_pem%;
17+
ssl_certificate_key %ssl_key%;
18+
ssl_stapling on;
19+
ssl_stapling_verify on;
20+
21+
# TLS 1.3 0-RTT anti-replay
22+
if ($anti_replay = 307) { return 307 https://$host$request_uri; }
23+
if ($anti_replay = 425) { return 425; }
24+
25+
include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
26+
27+
location ~ /\.(?!well-known\/) {
28+
deny all;
29+
return 404;
30+
}
31+
32+
location / {
33+
client_max_body_size 512M;
34+
35+
proxy_max_temp_file_size 0;
36+
proxy_read_timeout 120;
37+
proxy_redirect off;
38+
39+
proxy_set_header Host $http_host;
40+
proxy_set_header Early-Data $rfc_early_data;
41+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
42+
proxy_set_header X-Forwarded-Proto $scheme;
43+
proxy_set_header X-Real-IP $remote_addr;
44+
45+
proxy_pass http://localhost:3000;
46+
}
47+
48+
location /error/ {
49+
alias %home%/%user%/web/%domain%/document_errors/;
50+
}
51+
52+
location /vstats/ {
53+
alias %home%/%user%/web/%domain%/stats/;
54+
include %home%/%user%/web/%domain%/stats/auth.conf*;
55+
}
56+
57+
proxy_hide_header Upgrade;
58+
59+
include /etc/nginx/conf.d/phpmyadmin.inc*;
60+
include /etc/nginx/conf.d/phppgadmin.inc*;
61+
include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
62+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#=========================================================================#
2+
# Default Web Domain Template #
3+
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
4+
# https://hestiacp.com/docs/server-administration/web-templates.html #
5+
#=========================================================================#
6+
7+
server {
8+
listen %ip%:%web_port%;
9+
server_name %domain_idn% %alias_idn%;
10+
root %docroot%;
11+
index index.php index.html index.htm;
12+
access_log /var/log/nginx/domains/%domain%.log combined;
13+
access_log /var/log/nginx/domains/%domain%.bytes bytes;
14+
error_log /var/log/nginx/domains/%domain%.error.log error;
15+
16+
include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
17+
18+
location ~ /\.(?!well-known\/) {
19+
deny all;
20+
return 404;
21+
}
22+
23+
location / {
24+
client_max_body_size 512M;
25+
26+
proxy_max_temp_file_size 0;
27+
proxy_read_timeout 120;
28+
proxy_redirect off;
29+
30+
proxy_set_header Host $http_host;
31+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
32+
proxy_set_header X-Forwarded-Proto $scheme;
33+
proxy_set_header X-Real-IP $remote_addr;
34+
35+
proxy_pass http://localhost:3000;
36+
}
37+
38+
location /error/ {
39+
alias %home%/%user%/web/%domain%/document_errors/;
40+
}
41+
42+
location /vstats/ {
43+
alias %home%/%user%/web/%domain%/stats/;
44+
include %home%/%user%/web/%domain%/stats/auth.conf*;
45+
}
46+
47+
include /etc/nginx/conf.d/phpmyadmin.inc*;
48+
include /etc/nginx/conf.d/phppgadmin.inc*;
49+
include %home%/%user%/conf/web/%domain%/nginx.conf_*;
50+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#=========================================================================#
2+
# Default Web Domain Template #
3+
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
4+
# https://hestiacp.com/docs/server-administration/web-templates.html #
5+
#=========================================================================#
6+
7+
server {
8+
listen %ip%:%web_ssl_port% ssl;
9+
server_name %domain_idn% %alias_idn%;
10+
root %sdocroot%;
11+
index index.php index.html index.htm;
12+
access_log /var/log/nginx/domains/%domain%.log combined;
13+
access_log /var/log/nginx/domains/%domain%.bytes bytes;
14+
error_log /var/log/nginx/domains/%domain%.error.log error;
15+
16+
ssl_certificate %ssl_pem%;
17+
ssl_certificate_key %ssl_key%;
18+
ssl_stapling on;
19+
ssl_stapling_verify on;
20+
21+
# TLS 1.3 0-RTT anti-replay
22+
if ($anti_replay = 307) { return 307 https://$host$request_uri; }
23+
if ($anti_replay = 425) { return 425; }
24+
25+
include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
26+
27+
location ~ /\.(?!well-known\/) {
28+
deny all;
29+
return 404;
30+
}
31+
32+
location / {
33+
client_max_body_size 512M;
34+
35+
proxy_max_temp_file_size 0;
36+
proxy_read_timeout 120;
37+
proxy_redirect off;
38+
39+
proxy_set_header Host $http_host;
40+
proxy_set_header Early-Data $rfc_early_data;
41+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
42+
proxy_set_header X-Forwarded-Proto $scheme;
43+
proxy_set_header X-Real-IP $remote_addr;
44+
45+
proxy_pass http://localhost:6157;
46+
}
47+
48+
location /error/ {
49+
alias %home%/%user%/web/%domain%/document_errors/;
50+
}
51+
52+
location /vstats/ {
53+
alias %home%/%user%/web/%domain%/stats/;
54+
include %home%/%user%/web/%domain%/stats/auth.conf*;
55+
}
56+
57+
proxy_hide_header Upgrade;
58+
59+
include /etc/nginx/conf.d/phpmyadmin.inc*;
60+
include /etc/nginx/conf.d/phppgadmin.inc*;
61+
include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
62+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#=========================================================================#
2+
# Default Web Domain Template #
3+
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
4+
# https://hestiacp.com/docs/server-administration/web-templates.html #
5+
#=========================================================================#
6+
7+
server {
8+
listen %ip%:%web_port%;
9+
server_name %domain_idn% %alias_idn%;
10+
root %docroot%;
11+
index index.php index.html index.htm;
12+
access_log /var/log/nginx/domains/%domain%.log combined;
13+
access_log /var/log/nginx/domains/%domain%.bytes bytes;
14+
error_log /var/log/nginx/domains/%domain%.error.log error;
15+
16+
include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
17+
18+
location ~ /\.(?!well-known\/) {
19+
deny all;
20+
return 404;
21+
}
22+
23+
location / {
24+
client_max_body_size 512M;
25+
26+
proxy_max_temp_file_size 0;
27+
proxy_read_timeout 120;
28+
proxy_redirect off;
29+
30+
proxy_set_header Host $http_host;
31+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
32+
proxy_set_header X-Forwarded-Proto $scheme;
33+
proxy_set_header X-Real-IP $remote_addr;
34+
35+
proxy_pass http://localhost:6157;
36+
}
37+
38+
location /error/ {
39+
alias %home%/%user%/web/%domain%/document_errors/;
40+
}
41+
42+
location /vstats/ {
43+
alias %home%/%user%/web/%domain%/stats/;
44+
include %home%/%user%/web/%domain%/stats/auth.conf*;
45+
}
46+
47+
include /etc/nginx/conf.d/phpmyadmin.inc*;
48+
include /etc/nginx/conf.d/phppgadmin.inc*;
49+
include %home%/%user%/conf/web/%domain%/nginx.conf_*;
50+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#=========================================================================#
2+
# Default Web Domain Template #
3+
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
4+
# https://hestiacp.com/docs/server-administration/web-templates.html #
5+
#=========================================================================#
6+
7+
server {
8+
listen %ip%:%web_ssl_port% ssl;
9+
server_name %domain_idn% %alias_idn%;
10+
root %sdocroot%;
11+
index index.php index.html index.htm;
12+
access_log /var/log/nginx/domains/%domain%.log combined;
13+
access_log /var/log/nginx/domains/%domain%.bytes bytes;
14+
error_log /var/log/nginx/domains/%domain%.error.log error;
15+
16+
ssl_certificate %ssl_pem%;
17+
ssl_certificate_key %ssl_key%;
18+
ssl_stapling on;
19+
ssl_stapling_verify on;
20+
21+
# TLS 1.3 0-RTT anti-replay
22+
if ($anti_replay = 307) { return 307 https://$host$request_uri; }
23+
if ($anti_replay = 425) { return 425; }
24+
25+
include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
26+
27+
location ~ /\.(?!well-known\/) {
28+
deny all;
29+
return 404;
30+
}
31+
32+
location / {
33+
client_max_body_size 512M;
34+
35+
proxy_max_temp_file_size 0;
36+
proxy_read_timeout 120;
37+
proxy_redirect off;
38+
39+
proxy_set_header Host $http_host;
40+
proxy_set_header Early-Data $rfc_early_data;
41+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
42+
proxy_set_header X-Forwarded-Proto $scheme;
43+
proxy_set_header X-Real-IP $remote_addr;
44+
45+
proxy_pass http://localhost:3000;
46+
}
47+
48+
location /error/ {
49+
alias %home%/%user%/web/%domain%/document_errors/;
50+
}
51+
52+
location /vstats/ {
53+
alias %home%/%user%/web/%domain%/stats/;
54+
include %home%/%user%/web/%domain%/stats/auth.conf*;
55+
}
56+
57+
proxy_hide_header Upgrade;
58+
59+
include /etc/nginx/conf.d/phpmyadmin.inc*;
60+
include /etc/nginx/conf.d/phppgadmin.inc*;
61+
include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
62+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#=========================================================================#
2+
# Default Web Domain Template #
3+
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
4+
# https://hestiacp.com/docs/server-administration/web-templates.html #
5+
#=========================================================================#
6+
7+
server {
8+
listen %ip%:%web_port%;
9+
server_name %domain_idn% %alias_idn%;
10+
root %docroot%;
11+
index index.php index.html index.htm;
12+
access_log /var/log/nginx/domains/%domain%.log combined;
13+
access_log /var/log/nginx/domains/%domain%.bytes bytes;
14+
error_log /var/log/nginx/domains/%domain%.error.log error;
15+
16+
include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
17+
18+
location ~ /\.(?!well-known\/) {
19+
deny all;
20+
return 404;
21+
}
22+
23+
location / {
24+
client_max_body_size 512M;
25+
26+
proxy_max_temp_file_size 0;
27+
proxy_read_timeout 120;
28+
proxy_redirect off;
29+
30+
proxy_set_header Host $http_host;
31+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
32+
proxy_set_header X-Forwarded-Proto $scheme;
33+
proxy_set_header X-Real-IP $remote_addr;
34+
35+
proxy_pass http://localhost:3000;
36+
}
37+
38+
location /error/ {
39+
alias %home%/%user%/web/%domain%/document_errors/;
40+
}
41+
42+
location /vstats/ {
43+
alias %home%/%user%/web/%domain%/stats/;
44+
include %home%/%user%/web/%domain%/stats/auth.conf*;
45+
}
46+
47+
include /etc/nginx/conf.d/phpmyadmin.inc*;
48+
include /etc/nginx/conf.d/phppgadmin.inc*;
49+
include %home%/%user%/conf/web/%domain%/nginx.conf_*;
50+
}

0 commit comments

Comments
 (0)