diff --git a/install/nginx/inc/errors.conf b/install/nginx/inc/errors.conf index ab82928..ffc77ff 100644 --- a/install/nginx/inc/errors.conf +++ b/install/nginx/inc/errors.conf @@ -3,7 +3,7 @@ recursive_error_pages on; # 403 Forbidden error_page 403 @403; location @403 { - root /srv/servnest/errors; + root /srv/servnest/core/http-errors; try_files /403.html =500; } @@ -13,7 +13,7 @@ location @local404 { try_files /404.html /404.md /404.gmi @servnest404; } location @servnest404 { - root /srv/servnest/errors; + root /srv/servnest/core/http-errors; try_files /404.php =500; index /404.php; fastcgi_split_path_info ^(.+\.php)(/.+)$; @@ -25,48 +25,58 @@ location @servnest404 { # 405 Method Not Allowed error_page 405 @405; location @405 { - root /srv/servnest/errors; + root /srv/servnest/core/http-errors; try_files /405.html =500; } # 410 Gone error_page 410 @410; location @410 { - root /srv/servnest/errors; + root /srv/servnest/core/http-errors; try_files /410.html =500; } # 418 I'm a teapot error_page 418 @418; location @418 { - root /srv/servnest/errors; + root /srv/servnest/core/http-errors; try_files /418.html =500; } # 500 Internal Server Error error_page 500 @500; location @500 { - root /srv/servnest/errors; - try_files /500.html =500; + root /srv/servnest/core/http-errors; + try_files /500.php /500.en.html =500; + index /500.php; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass unix:/run/php-fpm/servnest.sock; + include inc/fastcgi.conf; + fastcgi_index /500.php; } # 502 Bad Gateway error_page 502 @502; location @502 { - root /srv/servnest/errors; + root /srv/servnest/core/http-errors; try_files /502.html =500; } # 503 Service Unavailable error_page 503 @503; location @503 { - root /srv/servnest/errors; - try_files /503.html =500; + root /srv/servnest/core/http-errors; + try_files /503.php =500; + index /503.php; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass unix:/run/php-fpm/servnest.sock; + include inc/fastcgi.conf; + fastcgi_index /503.php; } # 504 Gateway Timeout error_page 504 @504; location @504 { - root /srv/servnest/errors; + root /srv/servnest/core/http-errors; try_files /504.html =500; } diff --git a/install/nginx/sites/default-server.conf b/install/nginx/sites/default-server.conf index a4bd0c3..769b8a4 100644 --- a/install/nginx/sites/default-server.conf +++ b/install/nginx/sites/default-server.conf @@ -9,12 +9,8 @@ server { ssl_stapling off; - root /srv/servnest/errors; - try_files index.php index.html $uri $uri/; - index index.php index.html; - location / { - root /srv/servnest/errors; + root /srv/servnest/core/http-errors; try_files /index.php =500; index index.php; fastcgi_split_path_info ^(.+\.php)(/.+)$; diff --git a/install/nginx/sites/http.conf b/install/nginx/sites/http.conf index 08ee57b..6b2a58f 100644 --- a/install/nginx/sites/http.conf +++ b/install/nginx/sites/http.conf @@ -11,9 +11,9 @@ server { # Display an explanation page error_page 403 @http403; location @http403 { - root /srv/servnest/errors; - try_files /http.php =500; - index http.php; + root /srv/servnest/core/http-errors; + try_files /unsecure.php =500; + index unsecure.php; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/run/php-fpm/servnest.sock; include inc/fastcgi.conf; diff --git a/srv/servnest/errors/400.html b/srv/servnest/errors/400.html deleted file mode 100644 index 6330cbe..0000000 --- a/srv/servnest/errors/400.html +++ /dev/null @@ -1,15 +0,0 @@ - - -
- - -- The request is malformed. -
- HTTP400
-
-
diff --git a/srv/servnest/errors/403.html b/srv/servnest/errors/403.html
deleted file mode 100644
index 1c2fa6e..0000000
--- a/srv/servnest/errors/403.html
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
- - The server refused to process the request for security reasons. -
- HTTP403
-
-
diff --git a/srv/servnest/errors/404.en.html b/srv/servnest/errors/404.en.html
deleted file mode 100644
index d09c1d5..0000000
--- a/srv/servnest/errors/404.en.html
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
- - The server did not find anything at the requested address. -
-404
-
-
diff --git a/srv/servnest/errors/404.fr.html b/srv/servnest/errors/404.fr.html
deleted file mode 100644
index b9748e7..0000000
--- a/srv/servnest/errors/404.fr.html
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
- - Le serveur n'a rien trouvé à l'adresse demandée. -
-404
-
-
diff --git a/srv/servnest/errors/404.php b/srv/servnest/errors/404.php
deleted file mode 100644
index e58f81c..0000000
--- a/srv/servnest/errors/404.php
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
- - The request method is not supported for this resource. -
- HTTP405
-
-
diff --git a/srv/servnest/errors/410.html b/srv/servnest/errors/410.html
deleted file mode 100644
index 7b44cd6..0000000
--- a/srv/servnest/errors/410.html
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
- - The requested resource is not available anymore. -
- HTTP410
-
-
diff --git a/srv/servnest/errors/418.html b/srv/servnest/errors/418.html
deleted file mode 100644
index fcf0bf9..0000000
--- a/srv/servnest/errors/418.html
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
- - Your coffee cannot be brewed because this server is a teapot. -
- HTTP418
-
-
diff --git a/srv/servnest/errors/500.html b/srv/servnest/errors/500.html
deleted file mode 100644
index 88a41d5..0000000
--- a/srv/servnest/errors/500.html
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
- - The server encountered an error and is unable to satisfy your request. -
-500
-
-
diff --git a/srv/servnest/errors/502.html b/srv/servnest/errors/502.html
deleted file mode 100644
index 7e55459..0000000
--- a/srv/servnest/errors/502.html
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
- - The backend server encountered an error and is unable to satisfy your request. -
-502
-
-
diff --git a/srv/servnest/errors/503.html b/srv/servnest/errors/503.html
deleted file mode 100644
index 7e84963..0000000
--- a/srv/servnest/errors/503.html
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
- - The server cannot handle the request, because it is overloaded or down for maintenance. -
-503
-
-
diff --git a/srv/servnest/errors/504.html b/srv/servnest/errors/504.html
deleted file mode 100644
index 3a3b928..0000000
--- a/srv/servnest/errors/504.html
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
- - The backend server did not send a timely response. -
-504
-
-
diff --git a/srv/servnest/errors/default-domain.en.html b/srv/servnest/errors/default-domain.en.html
deleted file mode 100644
index c1d3c69..0000000
--- a/srv/servnest/errors/default-domain.en.html
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
- - The site you're trying to reach is misconfigured. This domain seems to be pointing to this server, but this server is not aware of a site using this domain. -
- HTTP404
-
-
diff --git a/srv/servnest/errors/default-ip.en.html b/srv/servnest/errors/default-ip.en.html
deleted file mode 100644
index bb17fe4..0000000
--- a/srv/servnest/errors/default-ip.en.html
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
- - You reached the default site of this server using IP address. There's nothing for you here. -
- HTTP404
-
-
diff --git a/srv/servnest/errors/http.php b/srv/servnest/errors/http.php
deleted file mode 100644
index 264a911..0000000
--- a/srv/servnest/errors/http.php
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
- - This site does not accept HTTP requests without TLS. -
-- You made a request using HTTP without TLS to the server, which refused this for privacy and security reasons, as unsecure HTTP connections can be watched and modified by any device on the way. -
-
- You can replace the URI scheme http
by https
to tell your client to make the request using TLS.
-
HTTP 403
-
-
diff --git a/srv/servnest/errors/unsecure.fr.php b/srv/servnest/errors/unsecure.fr.php
deleted file mode 100644
index 655cb2b..0000000
--- a/srv/servnest/errors/unsecure.fr.php
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
- - Ce site n'accepte pas les connexions HTTP sans TLS. -
-- Vous avez envoyé une requête HTTP sans TLS au serveur, qui l'a refusée pour des raisons de sécurité et de confidentialité. -
-
- Vous pouvez remplacer le schéma d'URI http
par https
pour indiquer à votre client de faire la requête avec TLS.
-
HTTP 403
-
-