servnest-mkosi/mkosi.extra/etc/nginx/inc/errors.conf

73 lines
1.3 KiB
Plaintext

recursive_error_pages on;
# 403 Forbidden
error_page 403 @403;
location @403 {
root /srv/servnest/errors;
try_files /403.html =500;
}
# 404 Not Found
error_page 404 @local404;
location @local404 {
try_files /404.html /404.md /404.gmi @servnest404;
}
location @servnest404 {
root /srv/servnest/errors;
try_files /404.php =500;
index /404.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php-fpm/servnest.sock;
include inc/fastcgi.conf;
fastcgi_index /404.php;
}
# 405 Method Not Allowed
error_page 405 @405;
location @405 {
root /srv/servnest/errors;
try_files /405.html =500;
}
# 410 Gone
error_page 410 @410;
location @410 {
root /srv/servnest/errors;
try_files /410.html =500;
}
# 418 I'm a teapot
error_page 418 @418;
location @418 {
root /srv/servnest/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;
}
# 502 Bad Gateway
error_page 502 @502;
location @502 {
root /srv/servnest/errors;
try_files /502.html =500;
}
# 503 Service Unavailable
error_page 503 @503;
location @503 {
root /srv/servnest/errors;
try_files /503.html =500;
}
# 504 Gateway Timeout
error_page 504 @504;
location @504 {
root /srv/servnest/errors;
try_files /504.html =500;
}