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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
|
# 创建 40x 错误页面 (客户端错误)
sudo tee /var/www/html/40x.html > /dev/null <<'EOF'
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>400 Bad Request - 请求错误</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
color: white;
text-align: center;
margin: 0;
padding: 20px;
}
.container {
background: rgba(255, 255, 255, 0.1);
padding: 3rem;
border-radius: 15px;
backdrop-filter: blur(10px);
max-width: 600px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
h1 {
font-size: 4rem;
margin: 0;
color: #ff6b6b;
}
h2 {
margin-top: 0;
font-weight: 300;
}
p {
line-height: 1.6;
margin-bottom: 2rem;
}
.btn {
display: inline-block;
padding: 12px 24px;
background: #4ecdc4;
color: white;
text-decoration: none;
border-radius: 25px;
transition: all 0.3s ease;
margin: 0 10px 10px 0;
}
.btn:hover {
background: #45b7aa;
transform: translateY(-2px);
}
@media (max-width: 600px) {
.container {
padding: 2rem;
}
h1 {
font-size: 3rem;
}
.btn {
display: block;
margin: 10px 0;
}
}
</style>
</head>
<body>
<div class="container">
<h1>400</h1>
<h2>糟糕!请求错误</h2>
<p>服务器无法理解您的请求,可能是语法格式不正确。</p>
<p>请检查您的输入或稍后再试。</p>
<a href="/" class="btn">返回首页</a>
<a href="mailto:support@example.com" class="btn">联系支持</a>
<a href="javascript:location.reload()" class="btn">刷新页面</a>
</div>
</body>
</html>
EOF
# 创建 50x 错误页面 (服务器错误)
sudo tee /var/www/html/50x.html > /dev/null <<'EOF'
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>503 Service Unavailable - 服务维护中</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
color: white;
text-align: center;
margin: 0;
padding: 20px;
}
.container {
background: rgba(255, 255, 255, 0.1);
padding: 3rem;
border-radius: 15px;
backdrop-filter: blur(10px);
max-width: 600px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
h1 {
font-size: 4rem;
margin: 0;
color: #ffeaa7;
}
h2 {
margin-top: 0;
font-weight: 300;
}
p {
line-height: 1.6;
margin-bottom: 2rem;
}
.progress {
background: rgba(255, 255, 255, 0.2);
height: 10px;
border-radius: 5px;
overflow: hidden;
margin: 2rem 0;
}
.progress-bar {
height: 100%;
width: 75%;
background: #74b9ff;
border-radius: 5px;
animation: progress 2s ease-in-out infinite;
}
@keyframes progress {
0% { width: 75%; }
50% { width: 85%; }
100% { width: 75%; }
}
.btn {
display: inline-block;
padding: 12px 24px;
background: #6c5ce7;
color: white;
text-decoration: none;
border-radius: 25px;
transition: all 0.3s ease;
margin: 0 10px 10px 0;
}
.btn:hover {
background: #5c4bc0;
transform: translateY(-2px);
}
@media (max-width: 600px) {
.container {
padding: 2rem;
}
h1 {
font-size: 3rem;
}
.btn {
display: block;
margin: 10px 0;
}
}
</style>
</head>
<body>
<div class="container">
<h1>503</h1>
<h2>网站维护中</h2>
<p>我们正在对网站进行维护升级,以提供更好的服务体验。</p>
<div class="progress">
<div class="progress-bar"></div>
</div>
<p>预计完成时间: 今天 18:00</p>
<a href="javascript:location.reload()" class="btn">刷新页面</a>
<a href="mailto:support@example.com" class="btn">联系支持</a>
<a href="/status" class="btn">查看状态页</a>
</div>
</body>
</html>
EOF
|