Mercurial > hg > nginx
annotate src/http/ngx_http_special_response.c @ 908:82adc19b4b4d
axe ngx_http_perl_cleanup_sv(): all SVs should be freed
by perl_free() in ngx_http_perl_cleanup_perl()
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 12 Dec 2006 20:06:04 +0000 |
parents | 1be87cdd010f |
children | bbde03037ef6 |
rev | line source |
---|---|
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
416
diff
changeset
|
1 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
416
diff
changeset
|
2 /* |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
441
diff
changeset
|
3 * Copyright (C) Igor Sysoev |
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
416
diff
changeset
|
4 */ |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
416
diff
changeset
|
5 |
98
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
6 |
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
7 #include <ngx_config.h> |
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
8 #include <ngx_core.h> |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
9 #include <ngx_http.h> |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
10 #include <nginx.h> |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
11 |
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
12 |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
233
diff
changeset
|
13 static u_char error_tail[] = |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
14 "<hr><center>" NGINX_VER "</center>" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
15 "</body>" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
16 "</html>" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
17 ; |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
18 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
19 |
501 | 20 static u_char ngx_http_msie_stub[] = |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
21 "<!-- The padding to disable MSIE's friendly error page -->" CRLF |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
22 "<!-- The padding to disable MSIE's friendly error page -->" CRLF |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
23 "<!-- The padding to disable MSIE's friendly error page -->" CRLF |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
24 "<!-- The padding to disable MSIE's friendly error page -->" CRLF |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
25 "<!-- The padding to disable MSIE's friendly error page -->" CRLF |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
26 "<!-- The padding to disable MSIE's friendly error page -->" CRLF |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
27 ; |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
28 |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
29 |
679 | 30 static u_char ngx_http_msie_refresh_head[] = |
31 "<html><head><meta http-equiv=\"Refresh\" content=\"0; URL="; | |
32 | |
33 | |
34 static u_char ngx_http_msie_refresh_tail[] = | |
35 "\"></head><body></body></html>" CRLF; | |
36 | |
37 | |
144
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
38 static char error_301_page[] = |
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
39 "<html>" CRLF |
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
40 "<head><title>301 Moved Permanently</title></head>" CRLF |
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
41 "<body bgcolor=\"white\">" CRLF |
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
42 "<center><h1>301 Moved Permanently</h1></center>" CRLF |
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
43 ; |
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
44 |
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
45 |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
46 static char error_302_page[] = |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
47 "<html>" CRLF |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
48 "<head><title>302 Found</title></head>" CRLF |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
49 "<body bgcolor=\"white\">" CRLF |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
50 "<center><h1>302 Found</h1></center>" CRLF |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
51 ; |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
52 |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
53 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
54 static char error_400_page[] = |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
55 "<html>" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
56 "<head><title>400 Bad Request</title></head>" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
57 "<body bgcolor=\"white\">" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
58 "<center><h1>400 Bad Request</h1></center>" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
59 ; |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
60 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
61 |
499 | 62 static char error_401_page[] = |
63 "<html>" CRLF | |
503 | 64 "<head><title>401 Authorization Required</title></head>" CRLF |
499 | 65 "<body bgcolor=\"white\">" CRLF |
503 | 66 "<center><h1>401 Authorization Required</h1></center>" CRLF |
499 | 67 ; |
68 | |
69 | |
70 static char error_402_page[] = | |
71 "<html>" CRLF | |
72 "<head><title>402 Payment Required</title></head>" CRLF | |
73 "<body bgcolor=\"white\">" CRLF | |
74 "<center><h1>402 Payment Required</h1></center>" CRLF | |
75 ; | |
76 | |
77 | |
45
f1ee46c036a4
nginx-0.0.1-2003-01-10-09:09:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
26
diff
changeset
|
78 static char error_403_page[] = |
f1ee46c036a4
nginx-0.0.1-2003-01-10-09:09:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
26
diff
changeset
|
79 "<html>" CRLF |
f1ee46c036a4
nginx-0.0.1-2003-01-10-09:09:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
26
diff
changeset
|
80 "<head><title>403 Forbidden</title></head>" CRLF |
f1ee46c036a4
nginx-0.0.1-2003-01-10-09:09:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
26
diff
changeset
|
81 "<body bgcolor=\"white\">" CRLF |
f1ee46c036a4
nginx-0.0.1-2003-01-10-09:09:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
26
diff
changeset
|
82 "<center><h1>403 Forbidden</h1></center>" CRLF |
f1ee46c036a4
nginx-0.0.1-2003-01-10-09:09:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
26
diff
changeset
|
83 ; |
f1ee46c036a4
nginx-0.0.1-2003-01-10-09:09:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
26
diff
changeset
|
84 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
85 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
86 static char error_404_page[] = |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
87 "<html>" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
88 "<head><title>404 Not Found</title></head>" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
89 "<body bgcolor=\"white\">" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
90 "<center><h1>404 Not Found</h1></center>" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
91 ; |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
92 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
93 |
96
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
94 static char error_405_page[] = |
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
95 "<html>" CRLF |
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
96 "<head><title>405 Not Allowed</title></head>" CRLF |
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
97 "<body bgcolor=\"white\">" CRLF |
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
98 "<center><h1>405 Not Allowed</h1></center>" CRLF |
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
99 ; |
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
100 |
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
101 |
499 | 102 static char error_406_page[] = |
103 "<html>" CRLF | |
104 "<head><title>406 Not Acceptable</title></head>" CRLF | |
105 "<body bgcolor=\"white\">" CRLF | |
106 "<center><h1>406 Not Acceptable</h1></center>" CRLF | |
107 ; | |
108 | |
109 | |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
110 static char error_408_page[] = |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
111 "<html>" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
112 "<head><title>408 Request Time-out</title></head>" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
113 "<body bgcolor=\"white\">" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
114 "<center><h1>408 Request Time-out</h1></center>" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
115 ; |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
116 |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
117 |
637 | 118 static char error_409_page[] = |
119 "<html>" CRLF | |
120 "<head><title>409 Conflict</title></head>" CRLF | |
121 "<body bgcolor=\"white\">" CRLF | |
122 "<center><h1>409 Conflict</h1></center>" CRLF | |
123 ; | |
124 | |
125 | |
499 | 126 static char error_410_page[] = |
127 "<html>" CRLF | |
128 "<head><title>410 Gone</title></head>" CRLF | |
129 "<body bgcolor=\"white\">" CRLF | |
130 "<center><h1>410 Gone</h1></center>" CRLF | |
131 ; | |
132 | |
133 | |
581 | 134 static char error_411_page[] = |
135 "<html>" CRLF | |
136 "<head><title>411 Length Required</title></head>" CRLF | |
137 "<body bgcolor=\"white\">" CRLF | |
138 "<center><h1>411 Length Required</h1></center>" CRLF | |
139 ; | |
140 | |
141 | |
162
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
142 static char error_413_page[] = |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
143 "<html>" CRLF |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
144 "<head><title>413 Request Entity Too Large</title></head>" CRLF |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
145 "<body bgcolor=\"white\">" CRLF |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
146 "<center><h1>413 Request Entity Too Large</h1></center>" CRLF |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
147 ; |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
148 |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
149 |
67
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
150 static char error_414_page[] = |
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
151 "<html>" CRLF |
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
152 "<head><title>414 Request-URI Too Large</title></head>" CRLF |
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
153 "<body bgcolor=\"white\">" CRLF |
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
154 "<center><h1>414 Request-URI Too Large</h1></center>" CRLF |
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
155 ; |
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
156 |
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
157 |
637 | 158 static char error_415_page[] = |
159 "<html>" CRLF | |
160 "<head><title>415 Unsupported Media Type</title></head>" CRLF | |
161 "<body bgcolor=\"white\">" CRLF | |
162 "<center><h1>415 Unsupported Media Type</h1></center>" CRLF | |
163 ; | |
164 | |
165 | |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
166 static char error_416_page[] = |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
167 "<html>" CRLF |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
168 "<head><title>416 Requested Range Not Satisfiable</title></head>" CRLF |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
169 "<body bgcolor=\"white\">" CRLF |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
170 "<center><h1>416 Requested Range Not Satisfiable</h1></center>" CRLF |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
171 ; |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
172 |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
173 |
647 | 174 static char error_495_page[] = |
175 "<html>" CRLF | |
176 "<head><title>400 The SSL certificate error</title></head>" | |
177 CRLF | |
178 "<body bgcolor=\"white\">" CRLF | |
179 "<center><h1>400 Bad Request</h1></center>" CRLF | |
180 "<center>The SSL certificate error</center>" CRLF | |
181 ; | |
182 | |
183 | |
184 static char error_496_page[] = | |
185 "<html>" CRLF | |
186 "<head><title>400 No required SSL certificate was sent</title></head>" | |
187 CRLF | |
188 "<body bgcolor=\"white\">" CRLF | |
189 "<center><h1>400 Bad Request</h1></center>" CRLF | |
190 "<center>No required SSL certificate was sent</center>" CRLF | |
191 ; | |
192 | |
193 | |
384
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
194 static char error_497_page[] = |
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
195 "<html>" CRLF |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
384
diff
changeset
|
196 "<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>" |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
384
diff
changeset
|
197 CRLF |
384
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
198 "<body bgcolor=\"white\">" CRLF |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
384
diff
changeset
|
199 "<center><h1>400 Bad Request</h1></center>" CRLF |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
384
diff
changeset
|
200 "<center>The plain HTTP request was sent to HTTPS port</center>" CRLF |
384
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
201 ; |
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
202 |
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
203 |
47
d81326c3b21b
nginx-0.0.1-2003-01-15-10:02:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
45
diff
changeset
|
204 static char error_500_page[] = |
d81326c3b21b
nginx-0.0.1-2003-01-15-10:02:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
45
diff
changeset
|
205 "<html>" CRLF |
d81326c3b21b
nginx-0.0.1-2003-01-15-10:02:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
45
diff
changeset
|
206 "<head><title>500 Internal Server Error</title></head>" CRLF |
d81326c3b21b
nginx-0.0.1-2003-01-15-10:02:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
45
diff
changeset
|
207 "<body bgcolor=\"white\">" CRLF |
d81326c3b21b
nginx-0.0.1-2003-01-15-10:02:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
45
diff
changeset
|
208 "<center><h1>500 Internal Server Error</h1></center>" CRLF |
d81326c3b21b
nginx-0.0.1-2003-01-15-10:02:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
45
diff
changeset
|
209 ; |
d81326c3b21b
nginx-0.0.1-2003-01-15-10:02:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
45
diff
changeset
|
210 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
211 |
233
4eaafcd57be7
nginx-0.0.1-2004-01-19-21:09:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
212 static char error_501_page[] = |
4eaafcd57be7
nginx-0.0.1-2004-01-19-21:09:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
213 "<html>" CRLF |
4eaafcd57be7
nginx-0.0.1-2004-01-19-21:09:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
214 "<head><title>501 Method Not Implemented</title></head>" CRLF |
4eaafcd57be7
nginx-0.0.1-2004-01-19-21:09:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
215 "<body bgcolor=\"white\">" CRLF |
535 | 216 "<center><h1>501 Method Not Implemented</h1></center>" CRLF |
233
4eaafcd57be7
nginx-0.0.1-2004-01-19-21:09:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
217 ; |
4eaafcd57be7
nginx-0.0.1-2004-01-19-21:09:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
218 |
4eaafcd57be7
nginx-0.0.1-2004-01-19-21:09:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
219 |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
220 static char error_502_page[] = |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
221 "<html>" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
222 "<head><title>502 Bad Gateway</title></head>" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
223 "<body bgcolor=\"white\">" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
224 "<center><h1>502 Bad Gateway</h1></center>" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
225 ; |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
226 |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
227 |
162
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
228 static char error_503_page[] = |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
229 "<html>" CRLF |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
230 "<head><title>503 Service Temporarily Unavailable</title></head>" CRLF |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
231 "<body bgcolor=\"white\">" CRLF |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
232 "<center><h1>503 Service Temporarily Unavailable</h1></center>" CRLF |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
233 ; |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
234 |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
235 |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
236 static char error_504_page[] = |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
237 "<html>" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
238 "<head><title>504 Gateway Time-out</title></head>" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
239 "<body bgcolor=\"white\">" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
240 "<center><h1>504 Gateway Time-out</h1></center>" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
241 ; |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
242 |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
243 |
637 | 244 static char error_507_page[] = |
245 "<html>" CRLF | |
246 "<head><title>507 Insufficient Storage</title></head>" CRLF | |
247 "<body bgcolor=\"white\">" CRLF | |
248 "<center><h1>507 Insufficient Storage</h1></center>" CRLF | |
249 ; | |
250 | |
251 | |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
252 static ngx_str_t error_pages[] = { |
499 | 253 |
633 | 254 ngx_null_string, /* 201, 204 */ |
511 | 255 |
256 #define NGX_HTTP_LEVEL_200 1 | |
257 | |
499 | 258 /* ngx_null_string, */ /* 300 */ |
144
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
259 ngx_string(error_301_page), |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
260 ngx_string(error_302_page), |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
261 ngx_null_string, /* 303 */ |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
262 |
499 | 263 #define NGX_HTTP_LEVEL_300 3 |
264 | |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
265 ngx_string(error_400_page), |
499 | 266 ngx_string(error_401_page), |
267 ngx_string(error_402_page), | |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
268 ngx_string(error_403_page), |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
269 ngx_string(error_404_page), |
96
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
270 ngx_string(error_405_page), |
499 | 271 ngx_string(error_406_page), |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
272 ngx_null_string, /* 407 */ |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
273 ngx_string(error_408_page), |
637 | 274 ngx_string(error_409_page), |
499 | 275 ngx_string(error_410_page), |
581 | 276 ngx_string(error_411_page), |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
277 ngx_null_string, /* 412 */ |
162
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
278 ngx_string(error_413_page), |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
279 ngx_string(error_414_page), |
637 | 280 ngx_string(error_415_page), |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
281 ngx_string(error_416_page), |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
282 |
499 | 283 #define NGX_HTTP_LEVEL_400 17 |
284 | |
647 | 285 ngx_string(error_495_page), /* 495, https certificate error */ |
286 ngx_string(error_496_page), /* 496, https no certificate */ | |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
384
diff
changeset
|
287 ngx_string(error_497_page), /* 497, http to https */ |
384
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
288 ngx_string(error_404_page), /* 498, invalid host name */ |
499 | 289 ngx_null_string, /* 499, client had closed connection */ |
335
d4241d7787fe
nginx-0.0.3-2004-05-14-20:51:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
331
diff
changeset
|
290 |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
291 ngx_string(error_500_page), |
233
4eaafcd57be7
nginx-0.0.1-2004-01-19-21:09:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
292 ngx_string(error_501_page), |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
293 ngx_string(error_502_page), |
162
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
294 ngx_string(error_503_page), |
637 | 295 ngx_string(error_504_page), |
296 ngx_null_string, /* 505 */ | |
297 ngx_null_string, /* 506 */ | |
298 ngx_string(error_507_page) | |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
299 }; |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
300 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
301 |
717
08652aae6fab
fix msvc build failure introduced by previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
716
diff
changeset
|
302 static ngx_str_t ngx_http_get_name = { 3, (u_char *) "GET " }; |
716
d8d7c39e3a76
allowing handling 400 errors via proxy_pass
Igor Sysoev <igor@sysoev.ru>
parents:
681
diff
changeset
|
303 |
d8d7c39e3a76
allowing handling 400 errors via proxy_pass
Igor Sysoev <igor@sysoev.ru>
parents:
681
diff
changeset
|
304 |
487 | 305 ngx_int_t |
306 ngx_http_special_response_handler(ngx_http_request_t *r, ngx_int_t error) | |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
307 { |
679 | 308 u_char *p; |
309 size_t msie_refresh; | |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
233
diff
changeset
|
310 ngx_int_t rc; |
673 | 311 ngx_buf_t *b; |
679 | 312 ngx_str_t *uri, *location; |
681 | 313 ngx_uint_t i, n, err, msie_padding; |
501 | 314 ngx_chain_t *out, *cl; |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
315 ngx_http_err_page_t *err_page; |
158
d377ee423603
nginx-0.0.1-2003-10-24-10:53:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
316 ngx_http_core_loc_conf_t *clcf; |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
317 |
527 | 318 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
319 "http special response: %d, \"%V\"", error, &r->uri); | |
320 | |
161
88abd07d9f62
nginx-0.0.1-2003-10-27-19:16:17 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
321 rc = ngx_http_discard_body(r); |
88abd07d9f62
nginx-0.0.1-2003-10-27-19:16:17 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
322 |
294
5cfd65b8b0a7
nginx-0.0.3-2004-03-23-09:01:52 import
Igor Sysoev <igor@sysoev.ru>
parents:
293
diff
changeset
|
323 if (rc == NGX_HTTP_INTERNAL_SERVER_ERROR) { |
5cfd65b8b0a7
nginx-0.0.3-2004-03-23-09:01:52 import
Igor Sysoev <igor@sysoev.ru>
parents:
293
diff
changeset
|
324 error = NGX_HTTP_INTERNAL_SERVER_ERROR; |
161
88abd07d9f62
nginx-0.0.1-2003-10-27-19:16:17 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
325 } |
88abd07d9f62
nginx-0.0.1-2003-10-27-19:16:17 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
326 |
677 | 327 r->err_status = error; |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
328 |
68
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
329 if (r->keepalive != 0) { |
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
330 switch (error) { |
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
331 case NGX_HTTP_BAD_REQUEST: |
162
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
332 case NGX_HTTP_REQUEST_ENTITY_TOO_LARGE: |
68
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
333 case NGX_HTTP_REQUEST_URI_TOO_LARGE: |
384
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
334 case NGX_HTTP_TO_HTTPS: |
647 | 335 case NGX_HTTPS_CERT_ERROR: |
336 case NGX_HTTPS_NO_CERT: | |
68
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
337 case NGX_HTTP_INTERNAL_SERVER_ERROR: |
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
338 r->keepalive = 0; |
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
339 } |
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
340 } |
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
341 |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
71
diff
changeset
|
342 if (r->lingering_close == 1) { |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
71
diff
changeset
|
343 switch (error) { |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
71
diff
changeset
|
344 case NGX_HTTP_BAD_REQUEST: |
384
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
345 case NGX_HTTP_TO_HTTPS: |
647 | 346 case NGX_HTTPS_CERT_ERROR: |
347 case NGX_HTTPS_NO_CERT: | |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
71
diff
changeset
|
348 r->lingering_close = 0; |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
71
diff
changeset
|
349 } |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
71
diff
changeset
|
350 } |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
71
diff
changeset
|
351 |
675 | 352 r->headers_out.content_type.len = 0; |
353 | |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
354 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
355 |
679 | 356 if (!r->error_page && clcf->error_pages) { |
357 | |
358 if (clcf->recursive_error_pages == 0) { | |
359 r->error_page = 1; | |
360 } | |
477 | 361 |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
362 err_page = clcf->error_pages->elts; |
477 | 363 |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
364 for (i = 0; i < clcf->error_pages->nelts; i++) { |
477 | 365 |
326
8733703a37f3
nginx-0.0.3-2004-04-26-00:13:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
323
diff
changeset
|
366 if (err_page[i].status == error) { |
555 | 367 r->err_status = err_page[i].overwrite; |
477 | 368 |
539 | 369 r->method = NGX_HTTP_GET; |
716
d8d7c39e3a76
allowing handling 400 errors via proxy_pass
Igor Sysoev <igor@sysoev.ru>
parents:
681
diff
changeset
|
370 r->method_name = ngx_http_get_name; |
539 | 371 |
673 | 372 uri = &err_page[i].uri; |
373 | |
374 if (err_page[i].uri_lengths) { | |
375 if (ngx_http_script_run(r, uri, | |
376 err_page[i].uri_lengths->elts, 0, | |
377 err_page[i].uri_values->elts) | |
378 == NULL) | |
379 { | |
380 return NGX_ERROR; | |
381 } | |
681 | 382 |
383 if (r->zero_in_uri) { | |
384 for (n = 0; n < uri->len; n++) { | |
385 if (uri->data[n] == '\0') { | |
386 goto zero; | |
387 } | |
388 } | |
389 | |
390 r->zero_in_uri = 0; | |
391 } | |
392 | |
393 } else { | |
394 r->zero_in_uri = 0; | |
673 | 395 } |
396 | |
681 | 397 zero: |
398 | |
673 | 399 if (uri->data[0] == '/') { |
400 return ngx_http_internal_redirect(r, uri, NULL); | |
555 | 401 } |
402 | |
403 r->headers_out.location = | |
404 ngx_list_push(&r->headers_out.headers); | |
405 | |
406 if (r->headers_out.location) { | |
675 | 407 error = NGX_HTTP_MOVED_TEMPORARILY; |
408 | |
555 | 409 r->err_status = NGX_HTTP_MOVED_TEMPORARILY; |
410 | |
411 r->headers_out.location->hash = 1; | |
412 r->headers_out.location->key.len = sizeof("Location") - 1; | |
413 r->headers_out.location->key.data = (u_char *) "Location"; | |
673 | 414 r->headers_out.location->value = *uri; |
555 | 415 |
416 } else { | |
673 | 417 return NGX_ERROR; |
555 | 418 } |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
419 } |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
420 } |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
421 } |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
422 |
633 | 423 if (error == NGX_HTTP_CREATED) { |
424 /* 201 */ | |
425 err = 0; | |
637 | 426 r->header_only = 1; |
633 | 427 |
428 } else if (error == NGX_HTTP_NO_CONTENT) { | |
511 | 429 /* 204 */ |
430 err = 0; | |
431 | |
432 } else if (error < NGX_HTTP_BAD_REQUEST) { | |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
433 /* 3XX */ |
513 | 434 err = error - NGX_HTTP_MOVED_PERMANENTLY + NGX_HTTP_LEVEL_200; |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
435 |
587 | 436 } else if (error < NGX_HTTP_OWN_CODES) { |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
437 /* 4XX */ |
511 | 438 err = error - NGX_HTTP_BAD_REQUEST + NGX_HTTP_LEVEL_200 |
439 + NGX_HTTP_LEVEL_300; | |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
440 |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
441 } else { |
335
d4241d7787fe
nginx-0.0.3-2004-05-14-20:51:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
331
diff
changeset
|
442 /* 49X, 5XX */ |
587 | 443 err = error - NGX_HTTP_OWN_CODES + NGX_HTTP_LEVEL_200 |
511 | 444 + NGX_HTTP_LEVEL_300 |
499 | 445 + NGX_HTTP_LEVEL_400; |
335
d4241d7787fe
nginx-0.0.3-2004-05-14-20:51:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
331
diff
changeset
|
446 switch (error) { |
384
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
447 case NGX_HTTP_TO_HTTPS: |
647 | 448 case NGX_HTTPS_CERT_ERROR: |
449 case NGX_HTTPS_NO_CERT: | |
679 | 450 r->err_status = NGX_HTTP_BAD_REQUEST; |
384
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
451 error = NGX_HTTP_BAD_REQUEST; |
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
452 break; |
335
d4241d7787fe
nginx-0.0.3-2004-05-14-20:51:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
331
diff
changeset
|
453 } |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
454 } |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
455 |
356
2e3cbc1bbe3c
nginx-0.0.7-2004-06-16-19:32:11 import
Igor Sysoev <igor@sysoev.ru>
parents:
343
diff
changeset
|
456 msie_padding = 0; |
2e3cbc1bbe3c
nginx-0.0.7-2004-06-16-19:32:11 import
Igor Sysoev <igor@sysoev.ru>
parents:
343
diff
changeset
|
457 |
730
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
458 if (!r->zero_body) { |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
459 if (error_pages[err].len) { |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
460 r->headers_out.content_length_n = error_pages[err].len |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
461 + sizeof(error_tail) - 1; |
331
f168a88e93f7
nginx-0.0.3-2004-05-04-21:56:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
326
diff
changeset
|
462 |
730
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
463 if (clcf->msie_padding |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
464 && r->headers_in.msie |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
465 && r->http_version >= NGX_HTTP_VERSION_10 |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
466 && error >= NGX_HTTP_BAD_REQUEST |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
467 && error != NGX_HTTP_REQUEST_URI_TOO_LARGE) |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
468 { |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
469 r->headers_out.content_length_n += |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
470 sizeof(ngx_http_msie_stub) - 1; |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
471 msie_padding = 1; |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
472 } |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
473 |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
474 r->headers_out.content_type.len = sizeof("text/html") - 1; |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
475 r->headers_out.content_type.data = (u_char *) "text/html"; |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
476 |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
477 } else { |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
478 r->headers_out.content_length_n = -1; |
331
f168a88e93f7
nginx-0.0.3-2004-05-04-21:56:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
326
diff
changeset
|
479 } |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
480 |
68
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
481 } else { |
730
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
482 r->headers_out.content_length_n = 0; |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
483 err = 0; |
165
894a01c6aea3
nginx-0.0.1-2003-10-29-20:39:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
164
diff
changeset
|
484 } |
894a01c6aea3
nginx-0.0.1-2003-10-29-20:39:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
164
diff
changeset
|
485 |
894a01c6aea3
nginx-0.0.1-2003-10-29-20:39:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
164
diff
changeset
|
486 if (r->headers_out.content_length) { |
509 | 487 r->headers_out.content_length->hash = 0; |
153
c71aeb75c071
nginx-0.0.1-2003-10-21-20:49:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
148
diff
changeset
|
488 r->headers_out.content_length = NULL; |
68
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
489 } |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
490 |
679 | 491 msie_refresh = 0; |
492 location = NULL; | |
493 | |
494 if (clcf->msie_refresh | |
495 && r->headers_in.msie | |
496 && (error == NGX_HTTP_MOVED_PERMANENTLY | |
497 || error == NGX_HTTP_MOVED_TEMPORARILY)) | |
498 { | |
499 location = &r->headers_out.location->value; | |
500 msie_refresh = sizeof(ngx_http_msie_refresh_head) - 1 | |
501 + location->len | |
502 + sizeof(ngx_http_msie_refresh_tail) - 1; | |
503 | |
504 r->err_status = NGX_HTTP_OK; | |
505 r->headers_out.content_type_len = sizeof("text/html") - 1; | |
506 r->headers_out.content_length_n = msie_refresh; | |
507 r->headers_out.location->hash = 0; | |
508 r->headers_out.location = NULL; | |
509 } | |
510 | |
577 | 511 ngx_http_clear_accept_ranges(r); |
512 ngx_http_clear_last_modified(r); | |
513 | |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
514 rc = ngx_http_send_header(r); |
142
cb77c084acdb
nginx-0.0.1-2003-10-09-11:00:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
103
diff
changeset
|
515 |
143
5526213be452
nginx-0.0.1-2003-10-10-19:10:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
142
diff
changeset
|
516 if (rc == NGX_ERROR || r->header_only) { |
5526213be452
nginx-0.0.1-2003-10-10-19:10:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
142
diff
changeset
|
517 return rc; |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
518 } |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
519 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
520 |
679 | 521 if (msie_refresh == 0) { |
501 | 522 |
679 | 523 if (error_pages[err].len == 0) { |
524 return NGX_OK; | |
525 } | |
501 | 526 |
527 b = ngx_calloc_buf(r->pool); | |
528 if (b == NULL) { | |
164
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
162
diff
changeset
|
529 return NGX_ERROR; |
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
162
diff
changeset
|
530 } |
501 | 531 |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
335
diff
changeset
|
532 b->memory = 1; |
679 | 533 b->pos = error_pages[err].data; |
534 b->last = error_pages[err].data + error_pages[err].len; | |
535 | |
536 cl = ngx_alloc_chain_link(r->pool); | |
537 if (cl == NULL) { | |
538 return NGX_ERROR; | |
539 } | |
540 | |
541 cl->buf = b; | |
542 out = cl; | |
543 | |
544 | |
545 b = ngx_calloc_buf(r->pool); | |
546 if (b == NULL) { | |
547 return NGX_ERROR; | |
548 } | |
549 | |
550 b->memory = 1; | |
551 b->pos = error_tail; | |
552 b->last = error_tail + sizeof(error_tail) - 1; | |
153
c71aeb75c071
nginx-0.0.1-2003-10-21-20:49:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
148
diff
changeset
|
553 |
501 | 554 cl->next = ngx_alloc_chain_link(r->pool); |
555 if (cl->next == NULL) { | |
556 return NGX_ERROR; | |
557 } | |
558 | |
559 cl = cl->next; | |
560 cl->buf = b; | |
679 | 561 |
562 if (msie_padding) { | |
563 b = ngx_calloc_buf(r->pool); | |
564 if (b == NULL) { | |
565 return NGX_ERROR; | |
566 } | |
567 | |
568 b->memory = 1; | |
569 b->pos = ngx_http_msie_stub; | |
570 b->last = ngx_http_msie_stub + sizeof(ngx_http_msie_stub) - 1; | |
571 | |
572 cl->next = ngx_alloc_chain_link(r->pool); | |
573 if (cl->next == NULL) { | |
574 return NGX_ERROR; | |
575 } | |
576 | |
577 cl = cl->next; | |
578 cl->buf = b; | |
579 } | |
580 | |
581 } else { | |
582 b = ngx_create_temp_buf(r->pool, msie_refresh); | |
583 if (b == NULL) { | |
584 return NGX_ERROR; | |
585 } | |
586 | |
587 p = ngx_cpymem(b->pos, ngx_http_msie_refresh_head, | |
588 sizeof(ngx_http_msie_refresh_head) - 1); | |
589 | |
590 p = ngx_cpymem(p, location->data, location->len); | |
591 | |
592 b->last = ngx_cpymem(p, ngx_http_msie_refresh_tail, | |
593 sizeof(ngx_http_msie_refresh_tail) - 1); | |
594 | |
595 cl = ngx_alloc_chain_link(r->pool); | |
596 if (cl == NULL) { | |
597 return NGX_ERROR; | |
598 } | |
599 | |
600 cl->buf = b; | |
601 out = cl; | |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
602 } |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
603 |
597 | 604 if (r == r->main) { |
509 | 605 b->last_buf = 1; |
606 } | |
607 | |
608 b->last_in_chain = 1; | |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
609 |
501 | 610 cl->next = NULL; |
611 | |
153
c71aeb75c071
nginx-0.0.1-2003-10-21-20:49:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
148
diff
changeset
|
612 return ngx_http_output_filter(r, out); |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
613 } |