Skip to content

Commit aa2a065

Browse files
Adding support for yourls (hestiacp#3755)
* Add files via upload Add support for https://yourls.org/ when nginx+php-fpm * Add files via upload Add support for https://yourls.org/ when nginx+php-fpm * Add files via upload Add support for https://yourls.org/ when nginx+php-fpm * Add RTT Protection + Fix spacing --------- Co-authored-by: Jaap Marcus <9754650+jaapmarcus@users.noreply.github.com>
1 parent bd42e56 commit aa2a065

File tree

4 files changed

+154
-0
lines changed

4 files changed

+154
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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%;
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+
# TLS 1.3 0-RTT anti-replay
21+
if ($anti_replay = 307) { return 307 https://$host$request_uri; }
22+
if ($anti_replay = 425) { return 425; }
23+
24+
include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
25+
26+
# Rewrites
27+
location / {
28+
try_files $uri $uri/ /yourls-loader.php$is_args$args;
29+
}
30+
31+
location ~ [^/]\.php(/|$) {
32+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
33+
if (!-f $document_root$fastcgi_script_name) {
34+
return 404;
35+
}
36+
37+
fastcgi_pass %backend_lsnr%;
38+
fastcgi_index index.php;
39+
include /etc/nginx/fastcgi_params;
40+
}
41+
42+
include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
43+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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%;
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+
# Rewrites
18+
location / {
19+
try_files $uri $uri/ /yourls-loader.php$is_args$args;
20+
}
21+
22+
location ~ [^/]\.php(/|$) {
23+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
24+
if (!-f $document_root$fastcgi_script_name) {
25+
return 404;
26+
}
27+
28+
fastcgi_pass %backend_lsnr%;
29+
fastcgi_index index.php;
30+
include /etc/nginx/fastcgi_params;
31+
}
32+
33+
include %home%/%user%/conf/web/%domain%/nginx.conf_*;
34+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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%;
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+
# TLS 1.3 0-RTT anti-replay
21+
if ($anti_replay = 307) { return 307 https://$host$request_uri; }
22+
if ($anti_replay = 425) { return 425; }
23+
24+
include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
25+
26+
# Rewrites
27+
location / {
28+
try_files $uri $uri/ /yourls-loader.php$is_args$args;
29+
}
30+
31+
location ~ [^/]\.php(/|$) {
32+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
33+
if (!-f $document_root$fastcgi_script_name) {
34+
return 404;
35+
}
36+
37+
fastcgi_pass %backend_lsnr%;
38+
fastcgi_index index.php;
39+
include /etc/nginx/fastcgi_params;
40+
}
41+
42+
include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
43+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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%;
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+
# Rewrites
18+
location / {
19+
try_files $uri $uri/ /yourls-loader.php$is_args$args;
20+
}
21+
22+
location ~ [^/]\.php(/|$) {
23+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
24+
if (!-f $document_root$fastcgi_script_name) {
25+
return 404;
26+
}
27+
28+
fastcgi_pass %backend_lsnr%;
29+
fastcgi_index index.php;
30+
include /etc/nginx/fastcgi_params;
31+
}
32+
33+
include %home%/%user%/conf/web/%domain%/nginx.conf_*;
34+
}

0 commit comments

Comments
 (0)