-
Notifications
You must be signed in to change notification settings - Fork 10
/
01_default.conf
47 lines (38 loc) · 1.25 KB
/
01_default.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
##
# Randomly choose the *.html (e.g. 00_xx.html) to be used as error page.
# If the target directory only contains a single HTML file,
# this file will be always the unique error page (A fixed error page).
#
# The error page (*.html) will be picked from the child directories of /etc/nginx/epage.d/
# e.g. /404/, /40x/, /50x/.
##
# Obmit the `[=[response]]` syntax to keep the error response code for clients.
## http://nginx.org/en/docs/http/ngx_http_core_module.html#error_page
error_page 404 /404/;
error_page 400 401 403 /40x/;
error_page 500 502 503 504 /50x/;
location /404/ {
internal;
random_index on;
root /etc/nginx/epage.d;
}
location /40x/ {
internal;
random_index on;
root /etc/nginx/epage.d;
# Replace the placeholders in response content
# for showing the corresponding status and message.
sub_filter '{{status}}' '$status';
sub_filter '{{status_msg}}' '$status_msg';
sub_filter_once off;
}
location /50x/ {
internal;
random_index on;
root /etc/nginx/epage.d;
# Replace the placeholders in response content
# for showing the corresponding status and message.
sub_filter '{{status}}' '$status';
sub_filter '{{status_msg}}' '$status_msg';
sub_filter_once off;
}