comparison src/http/ngx_http_special_response.c @ 7358:170922952477

Removed bgcolor attribute on body in error pages and autoindex. The bgcolor attribute overrides compatibility settings in browsers and leads to undesirable behavior when the default font color is set to white in the browser, since font-color is not also overridden.
author Nova DasSarma <nova@novalinium.com>
date Wed, 19 Sep 2018 09:26:47 -0500
parents 8801ff7d58e1
children d0d6cf5031a3
comparison
equal deleted inserted replaced
7357:548a63b354a2 7358:170922952477
58 58
59 59
60 static char ngx_http_error_301_page[] = 60 static char ngx_http_error_301_page[] =
61 "<html>" CRLF 61 "<html>" CRLF
62 "<head><title>301 Moved Permanently</title></head>" CRLF 62 "<head><title>301 Moved Permanently</title></head>" CRLF
63 "<body bgcolor=\"white\">" CRLF 63 "<body>" CRLF
64 "<center><h1>301 Moved Permanently</h1></center>" CRLF 64 "<center><h1>301 Moved Permanently</h1></center>" CRLF
65 ; 65 ;
66 66
67 67
68 static char ngx_http_error_302_page[] = 68 static char ngx_http_error_302_page[] =
69 "<html>" CRLF 69 "<html>" CRLF
70 "<head><title>302 Found</title></head>" CRLF 70 "<head><title>302 Found</title></head>" CRLF
71 "<body bgcolor=\"white\">" CRLF 71 "<body>" CRLF
72 "<center><h1>302 Found</h1></center>" CRLF 72 "<center><h1>302 Found</h1></center>" CRLF
73 ; 73 ;
74 74
75 75
76 static char ngx_http_error_303_page[] = 76 static char ngx_http_error_303_page[] =
77 "<html>" CRLF 77 "<html>" CRLF
78 "<head><title>303 See Other</title></head>" CRLF 78 "<head><title>303 See Other</title></head>" CRLF
79 "<body bgcolor=\"white\">" CRLF 79 "<body>" CRLF
80 "<center><h1>303 See Other</h1></center>" CRLF 80 "<center><h1>303 See Other</h1></center>" CRLF
81 ; 81 ;
82 82
83 83
84 static char ngx_http_error_307_page[] = 84 static char ngx_http_error_307_page[] =
85 "<html>" CRLF 85 "<html>" CRLF
86 "<head><title>307 Temporary Redirect</title></head>" CRLF 86 "<head><title>307 Temporary Redirect</title></head>" CRLF
87 "<body bgcolor=\"white\">" CRLF 87 "<body>" CRLF
88 "<center><h1>307 Temporary Redirect</h1></center>" CRLF 88 "<center><h1>307 Temporary Redirect</h1></center>" CRLF
89 ; 89 ;
90 90
91 91
92 static char ngx_http_error_308_page[] = 92 static char ngx_http_error_308_page[] =
93 "<html>" CRLF 93 "<html>" CRLF
94 "<head><title>308 Permanent Redirect</title></head>" CRLF 94 "<head><title>308 Permanent Redirect</title></head>" CRLF
95 "<body bgcolor=\"white\">" CRLF 95 "<body>" CRLF
96 "<center><h1>308 Permanent Redirect</h1></center>" CRLF 96 "<center><h1>308 Permanent Redirect</h1></center>" CRLF
97 ; 97 ;
98 98
99 99
100 static char ngx_http_error_400_page[] = 100 static char ngx_http_error_400_page[] =
101 "<html>" CRLF 101 "<html>" CRLF
102 "<head><title>400 Bad Request</title></head>" CRLF 102 "<head><title>400 Bad Request</title></head>" CRLF
103 "<body bgcolor=\"white\">" CRLF 103 "<body>" CRLF
104 "<center><h1>400 Bad Request</h1></center>" CRLF 104 "<center><h1>400 Bad Request</h1></center>" CRLF
105 ; 105 ;
106 106
107 107
108 static char ngx_http_error_401_page[] = 108 static char ngx_http_error_401_page[] =
109 "<html>" CRLF 109 "<html>" CRLF
110 "<head><title>401 Authorization Required</title></head>" CRLF 110 "<head><title>401 Authorization Required</title></head>" CRLF
111 "<body bgcolor=\"white\">" CRLF 111 "<body>" CRLF
112 "<center><h1>401 Authorization Required</h1></center>" CRLF 112 "<center><h1>401 Authorization Required</h1></center>" CRLF
113 ; 113 ;
114 114
115 115
116 static char ngx_http_error_402_page[] = 116 static char ngx_http_error_402_page[] =
117 "<html>" CRLF 117 "<html>" CRLF
118 "<head><title>402 Payment Required</title></head>" CRLF 118 "<head><title>402 Payment Required</title></head>" CRLF
119 "<body bgcolor=\"white\">" CRLF 119 "<body>" CRLF
120 "<center><h1>402 Payment Required</h1></center>" CRLF 120 "<center><h1>402 Payment Required</h1></center>" CRLF
121 ; 121 ;
122 122
123 123
124 static char ngx_http_error_403_page[] = 124 static char ngx_http_error_403_page[] =
125 "<html>" CRLF 125 "<html>" CRLF
126 "<head><title>403 Forbidden</title></head>" CRLF 126 "<head><title>403 Forbidden</title></head>" CRLF
127 "<body bgcolor=\"white\">" CRLF 127 "<body>" CRLF
128 "<center><h1>403 Forbidden</h1></center>" CRLF 128 "<center><h1>403 Forbidden</h1></center>" CRLF
129 ; 129 ;
130 130
131 131
132 static char ngx_http_error_404_page[] = 132 static char ngx_http_error_404_page[] =
133 "<html>" CRLF 133 "<html>" CRLF
134 "<head><title>404 Not Found</title></head>" CRLF 134 "<head><title>404 Not Found</title></head>" CRLF
135 "<body bgcolor=\"white\">" CRLF 135 "<body>" CRLF
136 "<center><h1>404 Not Found</h1></center>" CRLF 136 "<center><h1>404 Not Found</h1></center>" CRLF
137 ; 137 ;
138 138
139 139
140 static char ngx_http_error_405_page[] = 140 static char ngx_http_error_405_page[] =
141 "<html>" CRLF 141 "<html>" CRLF
142 "<head><title>405 Not Allowed</title></head>" CRLF 142 "<head><title>405 Not Allowed</title></head>" CRLF
143 "<body bgcolor=\"white\">" CRLF 143 "<body>" CRLF
144 "<center><h1>405 Not Allowed</h1></center>" CRLF 144 "<center><h1>405 Not Allowed</h1></center>" CRLF
145 ; 145 ;
146 146
147 147
148 static char ngx_http_error_406_page[] = 148 static char ngx_http_error_406_page[] =
149 "<html>" CRLF 149 "<html>" CRLF
150 "<head><title>406 Not Acceptable</title></head>" CRLF 150 "<head><title>406 Not Acceptable</title></head>" CRLF
151 "<body bgcolor=\"white\">" CRLF 151 "<body>" CRLF
152 "<center><h1>406 Not Acceptable</h1></center>" CRLF 152 "<center><h1>406 Not Acceptable</h1></center>" CRLF
153 ; 153 ;
154 154
155 155
156 static char ngx_http_error_408_page[] = 156 static char ngx_http_error_408_page[] =
157 "<html>" CRLF 157 "<html>" CRLF
158 "<head><title>408 Request Time-out</title></head>" CRLF 158 "<head><title>408 Request Time-out</title></head>" CRLF
159 "<body bgcolor=\"white\">" CRLF 159 "<body>" CRLF
160 "<center><h1>408 Request Time-out</h1></center>" CRLF 160 "<center><h1>408 Request Time-out</h1></center>" CRLF
161 ; 161 ;
162 162
163 163
164 static char ngx_http_error_409_page[] = 164 static char ngx_http_error_409_page[] =
165 "<html>" CRLF 165 "<html>" CRLF
166 "<head><title>409 Conflict</title></head>" CRLF 166 "<head><title>409 Conflict</title></head>" CRLF
167 "<body bgcolor=\"white\">" CRLF 167 "<body>" CRLF
168 "<center><h1>409 Conflict</h1></center>" CRLF 168 "<center><h1>409 Conflict</h1></center>" CRLF
169 ; 169 ;
170 170
171 171
172 static char ngx_http_error_410_page[] = 172 static char ngx_http_error_410_page[] =
173 "<html>" CRLF 173 "<html>" CRLF
174 "<head><title>410 Gone</title></head>" CRLF 174 "<head><title>410 Gone</title></head>" CRLF
175 "<body bgcolor=\"white\">" CRLF 175 "<body>" CRLF
176 "<center><h1>410 Gone</h1></center>" CRLF 176 "<center><h1>410 Gone</h1></center>" CRLF
177 ; 177 ;
178 178
179 179
180 static char ngx_http_error_411_page[] = 180 static char ngx_http_error_411_page[] =
181 "<html>" CRLF 181 "<html>" CRLF
182 "<head><title>411 Length Required</title></head>" CRLF 182 "<head><title>411 Length Required</title></head>" CRLF
183 "<body bgcolor=\"white\">" CRLF 183 "<body>" CRLF
184 "<center><h1>411 Length Required</h1></center>" CRLF 184 "<center><h1>411 Length Required</h1></center>" CRLF
185 ; 185 ;
186 186
187 187
188 static char ngx_http_error_412_page[] = 188 static char ngx_http_error_412_page[] =
189 "<html>" CRLF 189 "<html>" CRLF
190 "<head><title>412 Precondition Failed</title></head>" CRLF 190 "<head><title>412 Precondition Failed</title></head>" CRLF
191 "<body bgcolor=\"white\">" CRLF 191 "<body>" CRLF
192 "<center><h1>412 Precondition Failed</h1></center>" CRLF 192 "<center><h1>412 Precondition Failed</h1></center>" CRLF
193 ; 193 ;
194 194
195 195
196 static char ngx_http_error_413_page[] = 196 static char ngx_http_error_413_page[] =
197 "<html>" CRLF 197 "<html>" CRLF
198 "<head><title>413 Request Entity Too Large</title></head>" CRLF 198 "<head><title>413 Request Entity Too Large</title></head>" CRLF
199 "<body bgcolor=\"white\">" CRLF 199 "<body>" CRLF
200 "<center><h1>413 Request Entity Too Large</h1></center>" CRLF 200 "<center><h1>413 Request Entity Too Large</h1></center>" CRLF
201 ; 201 ;
202 202
203 203
204 static char ngx_http_error_414_page[] = 204 static char ngx_http_error_414_page[] =
205 "<html>" CRLF 205 "<html>" CRLF
206 "<head><title>414 Request-URI Too Large</title></head>" CRLF 206 "<head><title>414 Request-URI Too Large</title></head>" CRLF
207 "<body bgcolor=\"white\">" CRLF 207 "<body>" CRLF
208 "<center><h1>414 Request-URI Too Large</h1></center>" CRLF 208 "<center><h1>414 Request-URI Too Large</h1></center>" CRLF
209 ; 209 ;
210 210
211 211
212 static char ngx_http_error_415_page[] = 212 static char ngx_http_error_415_page[] =
213 "<html>" CRLF 213 "<html>" CRLF
214 "<head><title>415 Unsupported Media Type</title></head>" CRLF 214 "<head><title>415 Unsupported Media Type</title></head>" CRLF
215 "<body bgcolor=\"white\">" CRLF 215 "<body>" CRLF
216 "<center><h1>415 Unsupported Media Type</h1></center>" CRLF 216 "<center><h1>415 Unsupported Media Type</h1></center>" CRLF
217 ; 217 ;
218 218
219 219
220 static char ngx_http_error_416_page[] = 220 static char ngx_http_error_416_page[] =
221 "<html>" CRLF 221 "<html>" CRLF
222 "<head><title>416 Requested Range Not Satisfiable</title></head>" CRLF 222 "<head><title>416 Requested Range Not Satisfiable</title></head>" CRLF
223 "<body bgcolor=\"white\">" CRLF 223 "<body>" CRLF
224 "<center><h1>416 Requested Range Not Satisfiable</h1></center>" CRLF 224 "<center><h1>416 Requested Range Not Satisfiable</h1></center>" CRLF
225 ; 225 ;
226 226
227 227
228 static char ngx_http_error_421_page[] = 228 static char ngx_http_error_421_page[] =
229 "<html>" CRLF 229 "<html>" CRLF
230 "<head><title>421 Misdirected Request</title></head>" CRLF 230 "<head><title>421 Misdirected Request</title></head>" CRLF
231 "<body bgcolor=\"white\">" CRLF 231 "<body>" CRLF
232 "<center><h1>421 Misdirected Request</h1></center>" CRLF 232 "<center><h1>421 Misdirected Request</h1></center>" CRLF
233 ; 233 ;
234 234
235 235
236 static char ngx_http_error_429_page[] = 236 static char ngx_http_error_429_page[] =
237 "<html>" CRLF 237 "<html>" CRLF
238 "<head><title>429 Too Many Requests</title></head>" CRLF 238 "<head><title>429 Too Many Requests</title></head>" CRLF
239 "<body bgcolor=\"white\">" CRLF 239 "<body>" CRLF
240 "<center><h1>429 Too Many Requests</h1></center>" CRLF 240 "<center><h1>429 Too Many Requests</h1></center>" CRLF
241 ; 241 ;
242 242
243 243
244 static char ngx_http_error_494_page[] = 244 static char ngx_http_error_494_page[] =
245 "<html>" CRLF 245 "<html>" CRLF
246 "<head><title>400 Request Header Or Cookie Too Large</title></head>" 246 "<head><title>400 Request Header Or Cookie Too Large</title></head>"
247 CRLF 247 CRLF
248 "<body bgcolor=\"white\">" CRLF 248 "<body>" CRLF
249 "<center><h1>400 Bad Request</h1></center>" CRLF 249 "<center><h1>400 Bad Request</h1></center>" CRLF
250 "<center>Request Header Or Cookie Too Large</center>" CRLF 250 "<center>Request Header Or Cookie Too Large</center>" CRLF
251 ; 251 ;
252 252
253 253
254 static char ngx_http_error_495_page[] = 254 static char ngx_http_error_495_page[] =
255 "<html>" CRLF 255 "<html>" CRLF
256 "<head><title>400 The SSL certificate error</title></head>" 256 "<head><title>400 The SSL certificate error</title></head>"
257 CRLF 257 CRLF
258 "<body bgcolor=\"white\">" CRLF 258 "<body>" CRLF
259 "<center><h1>400 Bad Request</h1></center>" CRLF 259 "<center><h1>400 Bad Request</h1></center>" CRLF
260 "<center>The SSL certificate error</center>" CRLF 260 "<center>The SSL certificate error</center>" CRLF
261 ; 261 ;
262 262
263 263
264 static char ngx_http_error_496_page[] = 264 static char ngx_http_error_496_page[] =
265 "<html>" CRLF 265 "<html>" CRLF
266 "<head><title>400 No required SSL certificate was sent</title></head>" 266 "<head><title>400 No required SSL certificate was sent</title></head>"
267 CRLF 267 CRLF
268 "<body bgcolor=\"white\">" CRLF 268 "<body>" CRLF
269 "<center><h1>400 Bad Request</h1></center>" CRLF 269 "<center><h1>400 Bad Request</h1></center>" CRLF
270 "<center>No required SSL certificate was sent</center>" CRLF 270 "<center>No required SSL certificate was sent</center>" CRLF
271 ; 271 ;
272 272
273 273
274 static char ngx_http_error_497_page[] = 274 static char ngx_http_error_497_page[] =
275 "<html>" CRLF 275 "<html>" CRLF
276 "<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>" 276 "<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>"
277 CRLF 277 CRLF
278 "<body bgcolor=\"white\">" CRLF 278 "<body>" CRLF
279 "<center><h1>400 Bad Request</h1></center>" CRLF 279 "<center><h1>400 Bad Request</h1></center>" CRLF
280 "<center>The plain HTTP request was sent to HTTPS port</center>" CRLF 280 "<center>The plain HTTP request was sent to HTTPS port</center>" CRLF
281 ; 281 ;
282 282
283 283
284 static char ngx_http_error_500_page[] = 284 static char ngx_http_error_500_page[] =
285 "<html>" CRLF 285 "<html>" CRLF
286 "<head><title>500 Internal Server Error</title></head>" CRLF 286 "<head><title>500 Internal Server Error</title></head>" CRLF
287 "<body bgcolor=\"white\">" CRLF 287 "<body>" CRLF
288 "<center><h1>500 Internal Server Error</h1></center>" CRLF 288 "<center><h1>500 Internal Server Error</h1></center>" CRLF
289 ; 289 ;
290 290
291 291
292 static char ngx_http_error_501_page[] = 292 static char ngx_http_error_501_page[] =
293 "<html>" CRLF 293 "<html>" CRLF
294 "<head><title>501 Not Implemented</title></head>" CRLF 294 "<head><title>501 Not Implemented</title></head>" CRLF
295 "<body bgcolor=\"white\">" CRLF 295 "<body>" CRLF
296 "<center><h1>501 Not Implemented</h1></center>" CRLF 296 "<center><h1>501 Not Implemented</h1></center>" CRLF
297 ; 297 ;
298 298
299 299
300 static char ngx_http_error_502_page[] = 300 static char ngx_http_error_502_page[] =
301 "<html>" CRLF 301 "<html>" CRLF
302 "<head><title>502 Bad Gateway</title></head>" CRLF 302 "<head><title>502 Bad Gateway</title></head>" CRLF
303 "<body bgcolor=\"white\">" CRLF 303 "<body>" CRLF
304 "<center><h1>502 Bad Gateway</h1></center>" CRLF 304 "<center><h1>502 Bad Gateway</h1></center>" CRLF
305 ; 305 ;
306 306
307 307
308 static char ngx_http_error_503_page[] = 308 static char ngx_http_error_503_page[] =
309 "<html>" CRLF 309 "<html>" CRLF
310 "<head><title>503 Service Temporarily Unavailable</title></head>" CRLF 310 "<head><title>503 Service Temporarily Unavailable</title></head>" CRLF
311 "<body bgcolor=\"white\">" CRLF 311 "<body>" CRLF
312 "<center><h1>503 Service Temporarily Unavailable</h1></center>" CRLF 312 "<center><h1>503 Service Temporarily Unavailable</h1></center>" CRLF
313 ; 313 ;
314 314
315 315
316 static char ngx_http_error_504_page[] = 316 static char ngx_http_error_504_page[] =
317 "<html>" CRLF 317 "<html>" CRLF
318 "<head><title>504 Gateway Time-out</title></head>" CRLF 318 "<head><title>504 Gateway Time-out</title></head>" CRLF
319 "<body bgcolor=\"white\">" CRLF 319 "<body>" CRLF
320 "<center><h1>504 Gateway Time-out</h1></center>" CRLF 320 "<center><h1>504 Gateway Time-out</h1></center>" CRLF
321 ; 321 ;
322 322
323 323
324 static char ngx_http_error_505_page[] = 324 static char ngx_http_error_505_page[] =
325 "<html>" CRLF 325 "<html>" CRLF
326 "<head><title>505 HTTP Version Not Supported</title></head>" CRLF 326 "<head><title>505 HTTP Version Not Supported</title></head>" CRLF
327 "<body bgcolor=\"white\">" CRLF 327 "<body>" CRLF
328 "<center><h1>505 HTTP Version Not Supported</h1></center>" CRLF 328 "<center><h1>505 HTTP Version Not Supported</h1></center>" CRLF
329 ; 329 ;
330 330
331 331
332 static char ngx_http_error_507_page[] = 332 static char ngx_http_error_507_page[] =
333 "<html>" CRLF 333 "<html>" CRLF
334 "<head><title>507 Insufficient Storage</title></head>" CRLF 334 "<head><title>507 Insufficient Storage</title></head>" CRLF
335 "<body bgcolor=\"white\">" CRLF 335 "<body>" CRLF
336 "<center><h1>507 Insufficient Storage</h1></center>" CRLF 336 "<center><h1>507 Insufficient Storage</h1></center>" CRLF
337 ; 337 ;
338 338
339 339
340 static ngx_str_t ngx_http_error_pages[] = { 340 static ngx_str_t ngx_http_error_pages[] = {