Mercurial > hg > nginx-quic
annotate src/http/ngx_http_special_response.c @ 8214:e953bd2c5bb3 quic
QUIC: merged create_long/short_packet() functions.
They no longer differ.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 17 Nov 2020 21:33:12 +0000 |
parents | d0d6cf5031a3 |
children | ecc0ae881a25 |
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 |
4412 | 4 * Copyright (C) Nginx, Inc. |
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
|
5 */ |
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
|
6 |
98
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
7 |
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
8 #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
|
9 #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
|
10 #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
|
11 #include <nginx.h> |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
12 |
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
13 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
14 static ngx_int_t ngx_http_send_error_page(ngx_http_request_t *r, |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
15 ngx_http_err_page_t *err_page); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
16 static ngx_int_t ngx_http_send_special_response(ngx_http_request_t *r, |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
17 ngx_http_core_loc_conf_t *clcf, ngx_uint_t err); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
18 static ngx_int_t ngx_http_send_refresh(ngx_http_request_t *r); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
19 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
20 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
21 static u_char ngx_http_error_full_tail[] = |
1592 | 22 "<hr><center>" NGINX_VER "</center>" CRLF |
23 "</body>" CRLF | |
24 "</html>" CRLF | |
25 ; | |
26 | |
27 | |
6885
25203fc377fb
Implemented the "server_tokens build" option.
Ruslan Ermilov <ru@nginx.com>
parents:
6796
diff
changeset
|
28 static u_char ngx_http_error_build_tail[] = |
25203fc377fb
Implemented the "server_tokens build" option.
Ruslan Ermilov <ru@nginx.com>
parents:
6796
diff
changeset
|
29 "<hr><center>" NGINX_VER_BUILD "</center>" CRLF |
25203fc377fb
Implemented the "server_tokens build" option.
Ruslan Ermilov <ru@nginx.com>
parents:
6796
diff
changeset
|
30 "</body>" CRLF |
25203fc377fb
Implemented the "server_tokens build" option.
Ruslan Ermilov <ru@nginx.com>
parents:
6796
diff
changeset
|
31 "</html>" CRLF |
25203fc377fb
Implemented the "server_tokens build" option.
Ruslan Ermilov <ru@nginx.com>
parents:
6796
diff
changeset
|
32 ; |
25203fc377fb
Implemented the "server_tokens build" option.
Ruslan Ermilov <ru@nginx.com>
parents:
6796
diff
changeset
|
33 |
25203fc377fb
Implemented the "server_tokens build" option.
Ruslan Ermilov <ru@nginx.com>
parents:
6796
diff
changeset
|
34 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
35 static u_char ngx_http_error_tail[] = |
1592 | 36 "<hr><center>nginx</center>" CRLF |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
37 "</body>" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
38 "</html>" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
39 ; |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
40 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
41 |
3316
a63dd08379c4
add MSIE padding for Chrome too
Igor Sysoev <igor@sysoev.ru>
parents:
2882
diff
changeset
|
42 static u_char ngx_http_msie_padding[] = |
a63dd08379c4
add MSIE padding for Chrome too
Igor Sysoev <igor@sysoev.ru>
parents:
2882
diff
changeset
|
43 "<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF |
a63dd08379c4
add MSIE padding for Chrome too
Igor Sysoev <igor@sysoev.ru>
parents:
2882
diff
changeset
|
44 "<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF |
a63dd08379c4
add MSIE padding for Chrome too
Igor Sysoev <igor@sysoev.ru>
parents:
2882
diff
changeset
|
45 "<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF |
a63dd08379c4
add MSIE padding for Chrome too
Igor Sysoev <igor@sysoev.ru>
parents:
2882
diff
changeset
|
46 "<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF |
a63dd08379c4
add MSIE padding for Chrome too
Igor Sysoev <igor@sysoev.ru>
parents:
2882
diff
changeset
|
47 "<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF |
a63dd08379c4
add MSIE padding for Chrome too
Igor Sysoev <igor@sysoev.ru>
parents:
2882
diff
changeset
|
48 "<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
49 ; |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
50 |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
51 |
679 | 52 static u_char ngx_http_msie_refresh_head[] = |
53 "<html><head><meta http-equiv=\"Refresh\" content=\"0; URL="; | |
54 | |
55 | |
56 static u_char ngx_http_msie_refresh_tail[] = | |
57 "\"></head><body></body></html>" CRLF; | |
58 | |
59 | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
60 static char ngx_http_error_301_page[] = |
144
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
61 "<html>" CRLF |
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
62 "<head><title>301 Moved Permanently</title></head>" CRLF |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
63 "<body>" CRLF |
144
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
64 "<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
|
65 ; |
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
66 |
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
67 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
68 static char ngx_http_error_302_page[] = |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
69 "<html>" CRLF |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
70 "<head><title>302 Found</title></head>" CRLF |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
71 "<body>" CRLF |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
72 "<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
|
73 ; |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
74 |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
75 |
3631 | 76 static char ngx_http_error_303_page[] = |
77 "<html>" CRLF | |
78 "<head><title>303 See Other</title></head>" CRLF | |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
79 "<body>" CRLF |
3631 | 80 "<center><h1>303 See Other</h1></center>" CRLF |
81 ; | |
82 | |
83 | |
4491
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
84 static char ngx_http_error_307_page[] = |
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
85 "<html>" CRLF |
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
86 "<head><title>307 Temporary Redirect</title></head>" CRLF |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
87 "<body>" CRLF |
4491
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
88 "<center><h1>307 Temporary Redirect</h1></center>" CRLF |
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
89 ; |
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
90 |
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
91 |
6977
be5cfa918bfc
Added support for the "308 Permanent Redirect" (ticket #877).
Simon Leblanc <contact@leblanc-simon.eu>
parents:
6965
diff
changeset
|
92 static char ngx_http_error_308_page[] = |
be5cfa918bfc
Added support for the "308 Permanent Redirect" (ticket #877).
Simon Leblanc <contact@leblanc-simon.eu>
parents:
6965
diff
changeset
|
93 "<html>" CRLF |
be5cfa918bfc
Added support for the "308 Permanent Redirect" (ticket #877).
Simon Leblanc <contact@leblanc-simon.eu>
parents:
6965
diff
changeset
|
94 "<head><title>308 Permanent Redirect</title></head>" CRLF |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
95 "<body>" CRLF |
6977
be5cfa918bfc
Added support for the "308 Permanent Redirect" (ticket #877).
Simon Leblanc <contact@leblanc-simon.eu>
parents:
6965
diff
changeset
|
96 "<center><h1>308 Permanent Redirect</h1></center>" CRLF |
be5cfa918bfc
Added support for the "308 Permanent Redirect" (ticket #877).
Simon Leblanc <contact@leblanc-simon.eu>
parents:
6965
diff
changeset
|
97 ; |
be5cfa918bfc
Added support for the "308 Permanent Redirect" (ticket #877).
Simon Leblanc <contact@leblanc-simon.eu>
parents:
6965
diff
changeset
|
98 |
be5cfa918bfc
Added support for the "308 Permanent Redirect" (ticket #877).
Simon Leblanc <contact@leblanc-simon.eu>
parents:
6965
diff
changeset
|
99 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
100 static char ngx_http_error_400_page[] = |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
101 "<html>" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
102 "<head><title>400 Bad Request</title></head>" CRLF |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
103 "<body>" CRLF |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
104 "<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
|
105 ; |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
106 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
107 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
108 static char ngx_http_error_401_page[] = |
499 | 109 "<html>" CRLF |
503 | 110 "<head><title>401 Authorization Required</title></head>" CRLF |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
111 "<body>" CRLF |
503 | 112 "<center><h1>401 Authorization Required</h1></center>" CRLF |
499 | 113 ; |
114 | |
115 | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
116 static char ngx_http_error_402_page[] = |
499 | 117 "<html>" CRLF |
118 "<head><title>402 Payment Required</title></head>" CRLF | |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
119 "<body>" CRLF |
499 | 120 "<center><h1>402 Payment Required</h1></center>" CRLF |
121 ; | |
122 | |
123 | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
124 static char ngx_http_error_403_page[] = |
45
f1ee46c036a4
nginx-0.0.1-2003-01-10-09:09:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
26
diff
changeset
|
125 "<html>" CRLF |
f1ee46c036a4
nginx-0.0.1-2003-01-10-09:09:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
26
diff
changeset
|
126 "<head><title>403 Forbidden</title></head>" CRLF |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
127 "<body>" CRLF |
45
f1ee46c036a4
nginx-0.0.1-2003-01-10-09:09:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
26
diff
changeset
|
128 "<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
|
129 ; |
f1ee46c036a4
nginx-0.0.1-2003-01-10-09:09:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
26
diff
changeset
|
130 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
131 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
132 static char ngx_http_error_404_page[] = |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
133 "<html>" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
134 "<head><title>404 Not Found</title></head>" CRLF |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
135 "<body>" CRLF |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
136 "<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
|
137 ; |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
138 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
139 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
140 static char ngx_http_error_405_page[] = |
96
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
141 "<html>" CRLF |
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
142 "<head><title>405 Not Allowed</title></head>" CRLF |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
143 "<body>" CRLF |
96
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
144 "<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
|
145 ; |
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
146 |
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
147 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
148 static char ngx_http_error_406_page[] = |
499 | 149 "<html>" CRLF |
150 "<head><title>406 Not Acceptable</title></head>" CRLF | |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
151 "<body>" CRLF |
499 | 152 "<center><h1>406 Not Acceptable</h1></center>" CRLF |
153 ; | |
154 | |
155 | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
156 static char ngx_http_error_408_page[] = |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
157 "<html>" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
158 "<head><title>408 Request Time-out</title></head>" CRLF |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
159 "<body>" CRLF |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
160 "<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
|
161 ; |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
162 |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
163 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
164 static char ngx_http_error_409_page[] = |
637 | 165 "<html>" CRLF |
166 "<head><title>409 Conflict</title></head>" CRLF | |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
167 "<body>" CRLF |
637 | 168 "<center><h1>409 Conflict</h1></center>" CRLF |
169 ; | |
170 | |
171 | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
172 static char ngx_http_error_410_page[] = |
499 | 173 "<html>" CRLF |
174 "<head><title>410 Gone</title></head>" CRLF | |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
175 "<body>" CRLF |
499 | 176 "<center><h1>410 Gone</h1></center>" CRLF |
177 ; | |
178 | |
179 | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
180 static char ngx_http_error_411_page[] = |
581 | 181 "<html>" CRLF |
182 "<head><title>411 Length Required</title></head>" CRLF | |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
183 "<body>" CRLF |
581 | 184 "<center><h1>411 Length Required</h1></center>" CRLF |
185 ; | |
186 | |
187 | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
188 static char ngx_http_error_412_page[] = |
1057 | 189 "<html>" CRLF |
190 "<head><title>412 Precondition Failed</title></head>" CRLF | |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
191 "<body>" CRLF |
1057 | 192 "<center><h1>412 Precondition Failed</h1></center>" CRLF |
193 ; | |
194 | |
195 | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
196 static char ngx_http_error_413_page[] = |
162
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
197 "<html>" CRLF |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
198 "<head><title>413 Request Entity Too Large</title></head>" CRLF |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
199 "<body>" CRLF |
162
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
200 "<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
|
201 ; |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
202 |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
203 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
204 static char ngx_http_error_414_page[] = |
67
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
205 "<html>" CRLF |
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
206 "<head><title>414 Request-URI Too Large</title></head>" CRLF |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
207 "<body>" CRLF |
67
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
208 "<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
|
209 ; |
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
210 |
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
211 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
212 static char ngx_http_error_415_page[] = |
637 | 213 "<html>" CRLF |
214 "<head><title>415 Unsupported Media Type</title></head>" CRLF | |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
215 "<body>" CRLF |
637 | 216 "<center><h1>415 Unsupported Media Type</h1></center>" CRLF |
217 ; | |
218 | |
219 | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
220 static char ngx_http_error_416_page[] = |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
221 "<html>" CRLF |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
222 "<head><title>416 Requested Range Not Satisfiable</title></head>" CRLF |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
223 "<body>" CRLF |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
224 "<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
|
225 ; |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
226 |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
227 |
6556
654d2dae97d3
HTTP/2: the "421 Misdirected Request" response (closes #848).
Valentin Bartenev <vbart@nginx.com>
parents:
6451
diff
changeset
|
228 static char ngx_http_error_421_page[] = |
654d2dae97d3
HTTP/2: the "421 Misdirected Request" response (closes #848).
Valentin Bartenev <vbart@nginx.com>
parents:
6451
diff
changeset
|
229 "<html>" CRLF |
654d2dae97d3
HTTP/2: the "421 Misdirected Request" response (closes #848).
Valentin Bartenev <vbart@nginx.com>
parents:
6451
diff
changeset
|
230 "<head><title>421 Misdirected Request</title></head>" CRLF |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
231 "<body>" CRLF |
6556
654d2dae97d3
HTTP/2: the "421 Misdirected Request" response (closes #848).
Valentin Bartenev <vbart@nginx.com>
parents:
6451
diff
changeset
|
232 "<center><h1>421 Misdirected Request</h1></center>" CRLF |
654d2dae97d3
HTTP/2: the "421 Misdirected Request" response (closes #848).
Valentin Bartenev <vbart@nginx.com>
parents:
6451
diff
changeset
|
233 ; |
654d2dae97d3
HTTP/2: the "421 Misdirected Request" response (closes #848).
Valentin Bartenev <vbart@nginx.com>
parents:
6451
diff
changeset
|
234 |
654d2dae97d3
HTTP/2: the "421 Misdirected Request" response (closes #848).
Valentin Bartenev <vbart@nginx.com>
parents:
6451
diff
changeset
|
235 |
6965
3ef4cadfad7f
Added support for "429 Too Many Requests" response (RFC6585).
Piotr Sikora <piotrsikora@google.com>
parents:
6885
diff
changeset
|
236 static char ngx_http_error_429_page[] = |
3ef4cadfad7f
Added support for "429 Too Many Requests" response (RFC6585).
Piotr Sikora <piotrsikora@google.com>
parents:
6885
diff
changeset
|
237 "<html>" CRLF |
3ef4cadfad7f
Added support for "429 Too Many Requests" response (RFC6585).
Piotr Sikora <piotrsikora@google.com>
parents:
6885
diff
changeset
|
238 "<head><title>429 Too Many Requests</title></head>" CRLF |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
239 "<body>" CRLF |
6965
3ef4cadfad7f
Added support for "429 Too Many Requests" response (RFC6585).
Piotr Sikora <piotrsikora@google.com>
parents:
6885
diff
changeset
|
240 "<center><h1>429 Too Many Requests</h1></center>" CRLF |
3ef4cadfad7f
Added support for "429 Too Many Requests" response (RFC6585).
Piotr Sikora <piotrsikora@google.com>
parents:
6885
diff
changeset
|
241 ; |
3ef4cadfad7f
Added support for "429 Too Many Requests" response (RFC6585).
Piotr Sikora <piotrsikora@google.com>
parents:
6885
diff
changeset
|
242 |
3ef4cadfad7f
Added support for "429 Too Many Requests" response (RFC6585).
Piotr Sikora <piotrsikora@google.com>
parents:
6885
diff
changeset
|
243 |
3848
de59ad6bf557
introduce 494 code "Request Header Too Large"
Igor Sysoev <igor@sysoev.ru>
parents:
3845
diff
changeset
|
244 static char ngx_http_error_494_page[] = |
de59ad6bf557
introduce 494 code "Request Header Too Large"
Igor Sysoev <igor@sysoev.ru>
parents:
3845
diff
changeset
|
245 "<html>" CRLF |
de59ad6bf557
introduce 494 code "Request Header Too Large"
Igor Sysoev <igor@sysoev.ru>
parents:
3845
diff
changeset
|
246 "<head><title>400 Request Header Or Cookie Too Large</title></head>" |
de59ad6bf557
introduce 494 code "Request Header Too Large"
Igor Sysoev <igor@sysoev.ru>
parents:
3845
diff
changeset
|
247 CRLF |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
248 "<body>" CRLF |
3848
de59ad6bf557
introduce 494 code "Request Header Too Large"
Igor Sysoev <igor@sysoev.ru>
parents:
3845
diff
changeset
|
249 "<center><h1>400 Bad Request</h1></center>" CRLF |
de59ad6bf557
introduce 494 code "Request Header Too Large"
Igor Sysoev <igor@sysoev.ru>
parents:
3845
diff
changeset
|
250 "<center>Request Header Or Cookie Too Large</center>" CRLF |
de59ad6bf557
introduce 494 code "Request Header Too Large"
Igor Sysoev <igor@sysoev.ru>
parents:
3845
diff
changeset
|
251 ; |
de59ad6bf557
introduce 494 code "Request Header Too Large"
Igor Sysoev <igor@sysoev.ru>
parents:
3845
diff
changeset
|
252 |
de59ad6bf557
introduce 494 code "Request Header Too Large"
Igor Sysoev <igor@sysoev.ru>
parents:
3845
diff
changeset
|
253 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
254 static char ngx_http_error_495_page[] = |
647 | 255 "<html>" CRLF |
256 "<head><title>400 The SSL certificate error</title></head>" | |
257 CRLF | |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
258 "<body>" CRLF |
647 | 259 "<center><h1>400 Bad Request</h1></center>" CRLF |
260 "<center>The SSL certificate error</center>" CRLF | |
261 ; | |
262 | |
263 | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
264 static char ngx_http_error_496_page[] = |
647 | 265 "<html>" CRLF |
266 "<head><title>400 No required SSL certificate was sent</title></head>" | |
267 CRLF | |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
268 "<body>" CRLF |
647 | 269 "<center><h1>400 Bad Request</h1></center>" CRLF |
270 "<center>No required SSL certificate was sent</center>" CRLF | |
271 ; | |
272 | |
273 | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
274 static char ngx_http_error_497_page[] = |
384
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
275 "<html>" CRLF |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
384
diff
changeset
|
276 "<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
|
277 CRLF |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
278 "<body>" CRLF |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
384
diff
changeset
|
279 "<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
|
280 "<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
|
281 ; |
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
282 |
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
283 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
284 static char ngx_http_error_500_page[] = |
47
d81326c3b21b
nginx-0.0.1-2003-01-15-10:02:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
45
diff
changeset
|
285 "<html>" CRLF |
d81326c3b21b
nginx-0.0.1-2003-01-15-10:02:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
45
diff
changeset
|
286 "<head><title>500 Internal Server Error</title></head>" CRLF |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
287 "<body>" CRLF |
47
d81326c3b21b
nginx-0.0.1-2003-01-15-10:02:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
45
diff
changeset
|
288 "<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
|
289 ; |
d81326c3b21b
nginx-0.0.1-2003-01-15-10:02:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
45
diff
changeset
|
290 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
291 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
292 static char ngx_http_error_501_page[] = |
233
4eaafcd57be7
nginx-0.0.1-2004-01-19-21:09:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
293 "<html>" CRLF |
4920
812c4765c954
Request body: fixed "501 Not Implemented" error handling.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4746
diff
changeset
|
294 "<head><title>501 Not Implemented</title></head>" CRLF |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
295 "<body>" CRLF |
4920
812c4765c954
Request body: fixed "501 Not Implemented" error handling.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4746
diff
changeset
|
296 "<center><h1>501 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
|
297 ; |
4eaafcd57be7
nginx-0.0.1-2004-01-19-21:09:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
298 |
4eaafcd57be7
nginx-0.0.1-2004-01-19-21:09:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
299 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
300 static char ngx_http_error_502_page[] = |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
301 "<html>" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
302 "<head><title>502 Bad Gateway</title></head>" CRLF |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
303 "<body>" CRLF |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
304 "<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
|
305 ; |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
306 |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
307 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
308 static char ngx_http_error_503_page[] = |
162
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
309 "<html>" CRLF |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
310 "<head><title>503 Service Temporarily Unavailable</title></head>" CRLF |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
311 "<body>" CRLF |
162
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
312 "<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
|
313 ; |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
314 |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
315 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
316 static char ngx_http_error_504_page[] = |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
317 "<html>" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
318 "<head><title>504 Gateway Time-out</title></head>" CRLF |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
319 "<body>" CRLF |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
320 "<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
|
321 ; |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
322 |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
323 |
6993
8801ff7d58e1
Don't pretend we support HTTP major versions >1 as HTTP/1.1.
Ruslan Ermilov <ru@nginx.com>
parents:
6977
diff
changeset
|
324 static char ngx_http_error_505_page[] = |
8801ff7d58e1
Don't pretend we support HTTP major versions >1 as HTTP/1.1.
Ruslan Ermilov <ru@nginx.com>
parents:
6977
diff
changeset
|
325 "<html>" CRLF |
8801ff7d58e1
Don't pretend we support HTTP major versions >1 as HTTP/1.1.
Ruslan Ermilov <ru@nginx.com>
parents:
6977
diff
changeset
|
326 "<head><title>505 HTTP Version Not Supported</title></head>" CRLF |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
327 "<body>" CRLF |
6993
8801ff7d58e1
Don't pretend we support HTTP major versions >1 as HTTP/1.1.
Ruslan Ermilov <ru@nginx.com>
parents:
6977
diff
changeset
|
328 "<center><h1>505 HTTP Version Not Supported</h1></center>" CRLF |
8801ff7d58e1
Don't pretend we support HTTP major versions >1 as HTTP/1.1.
Ruslan Ermilov <ru@nginx.com>
parents:
6977
diff
changeset
|
329 ; |
8801ff7d58e1
Don't pretend we support HTTP major versions >1 as HTTP/1.1.
Ruslan Ermilov <ru@nginx.com>
parents:
6977
diff
changeset
|
330 |
8801ff7d58e1
Don't pretend we support HTTP major versions >1 as HTTP/1.1.
Ruslan Ermilov <ru@nginx.com>
parents:
6977
diff
changeset
|
331 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
332 static char ngx_http_error_507_page[] = |
637 | 333 "<html>" CRLF |
334 "<head><title>507 Insufficient Storage</title></head>" CRLF | |
7358
170922952477
Removed bgcolor attribute on body in error pages and autoindex.
Nova DasSarma <nova@novalinium.com>
parents:
6993
diff
changeset
|
335 "<body>" CRLF |
637 | 336 "<center><h1>507 Insufficient Storage</h1></center>" CRLF |
337 ; | |
338 | |
339 | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
340 static ngx_str_t ngx_http_error_pages[] = { |
499 | 341 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
342 ngx_null_string, /* 201, 204 */ |
511 | 343 |
4490
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
344 #define NGX_HTTP_LAST_2XX 202 |
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
345 #define NGX_HTTP_OFF_3XX (NGX_HTTP_LAST_2XX - 201) |
511 | 346 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
347 /* ngx_null_string, */ /* 300 */ |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
348 ngx_string(ngx_http_error_301_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
349 ngx_string(ngx_http_error_302_page), |
3631 | 350 ngx_string(ngx_http_error_303_page), |
4491
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
351 ngx_null_string, /* 304 */ |
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
352 ngx_null_string, /* 305 */ |
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
353 ngx_null_string, /* 306 */ |
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
354 ngx_string(ngx_http_error_307_page), |
6977
be5cfa918bfc
Added support for the "308 Permanent Redirect" (ticket #877).
Simon Leblanc <contact@leblanc-simon.eu>
parents:
6965
diff
changeset
|
355 ngx_string(ngx_http_error_308_page), |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
356 |
6977
be5cfa918bfc
Added support for the "308 Permanent Redirect" (ticket #877).
Simon Leblanc <contact@leblanc-simon.eu>
parents:
6965
diff
changeset
|
357 #define NGX_HTTP_LAST_3XX 309 |
4490
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
358 #define NGX_HTTP_OFF_4XX (NGX_HTTP_LAST_3XX - 301 + NGX_HTTP_OFF_3XX) |
499 | 359 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
360 ngx_string(ngx_http_error_400_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
361 ngx_string(ngx_http_error_401_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
362 ngx_string(ngx_http_error_402_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
363 ngx_string(ngx_http_error_403_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
364 ngx_string(ngx_http_error_404_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
365 ngx_string(ngx_http_error_405_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
366 ngx_string(ngx_http_error_406_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
367 ngx_null_string, /* 407 */ |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
368 ngx_string(ngx_http_error_408_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
369 ngx_string(ngx_http_error_409_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
370 ngx_string(ngx_http_error_410_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
371 ngx_string(ngx_http_error_411_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
372 ngx_string(ngx_http_error_412_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
373 ngx_string(ngx_http_error_413_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
374 ngx_string(ngx_http_error_414_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
375 ngx_string(ngx_http_error_415_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
376 ngx_string(ngx_http_error_416_page), |
6556
654d2dae97d3
HTTP/2: the "421 Misdirected Request" response (closes #848).
Valentin Bartenev <vbart@nginx.com>
parents:
6451
diff
changeset
|
377 ngx_null_string, /* 417 */ |
654d2dae97d3
HTTP/2: the "421 Misdirected Request" response (closes #848).
Valentin Bartenev <vbart@nginx.com>
parents:
6451
diff
changeset
|
378 ngx_null_string, /* 418 */ |
654d2dae97d3
HTTP/2: the "421 Misdirected Request" response (closes #848).
Valentin Bartenev <vbart@nginx.com>
parents:
6451
diff
changeset
|
379 ngx_null_string, /* 419 */ |
654d2dae97d3
HTTP/2: the "421 Misdirected Request" response (closes #848).
Valentin Bartenev <vbart@nginx.com>
parents:
6451
diff
changeset
|
380 ngx_null_string, /* 420 */ |
654d2dae97d3
HTTP/2: the "421 Misdirected Request" response (closes #848).
Valentin Bartenev <vbart@nginx.com>
parents:
6451
diff
changeset
|
381 ngx_string(ngx_http_error_421_page), |
6965
3ef4cadfad7f
Added support for "429 Too Many Requests" response (RFC6585).
Piotr Sikora <piotrsikora@google.com>
parents:
6885
diff
changeset
|
382 ngx_null_string, /* 422 */ |
3ef4cadfad7f
Added support for "429 Too Many Requests" response (RFC6585).
Piotr Sikora <piotrsikora@google.com>
parents:
6885
diff
changeset
|
383 ngx_null_string, /* 423 */ |
3ef4cadfad7f
Added support for "429 Too Many Requests" response (RFC6585).
Piotr Sikora <piotrsikora@google.com>
parents:
6885
diff
changeset
|
384 ngx_null_string, /* 424 */ |
3ef4cadfad7f
Added support for "429 Too Many Requests" response (RFC6585).
Piotr Sikora <piotrsikora@google.com>
parents:
6885
diff
changeset
|
385 ngx_null_string, /* 425 */ |
3ef4cadfad7f
Added support for "429 Too Many Requests" response (RFC6585).
Piotr Sikora <piotrsikora@google.com>
parents:
6885
diff
changeset
|
386 ngx_null_string, /* 426 */ |
3ef4cadfad7f
Added support for "429 Too Many Requests" response (RFC6585).
Piotr Sikora <piotrsikora@google.com>
parents:
6885
diff
changeset
|
387 ngx_null_string, /* 427 */ |
3ef4cadfad7f
Added support for "429 Too Many Requests" response (RFC6585).
Piotr Sikora <piotrsikora@google.com>
parents:
6885
diff
changeset
|
388 ngx_null_string, /* 428 */ |
3ef4cadfad7f
Added support for "429 Too Many Requests" response (RFC6585).
Piotr Sikora <piotrsikora@google.com>
parents:
6885
diff
changeset
|
389 ngx_string(ngx_http_error_429_page), |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
390 |
6965
3ef4cadfad7f
Added support for "429 Too Many Requests" response (RFC6585).
Piotr Sikora <piotrsikora@google.com>
parents:
6885
diff
changeset
|
391 #define NGX_HTTP_LAST_4XX 430 |
4490
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
392 #define NGX_HTTP_OFF_5XX (NGX_HTTP_LAST_4XX - 400 + NGX_HTTP_OFF_4XX) |
499 | 393 |
3848
de59ad6bf557
introduce 494 code "Request Header Too Large"
Igor Sysoev <igor@sysoev.ru>
parents:
3845
diff
changeset
|
394 ngx_string(ngx_http_error_494_page), /* 494, request header too large */ |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
395 ngx_string(ngx_http_error_495_page), /* 495, https certificate error */ |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
396 ngx_string(ngx_http_error_496_page), /* 496, https no certificate */ |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
397 ngx_string(ngx_http_error_497_page), /* 497, http to https */ |
1672 | 398 ngx_string(ngx_http_error_404_page), /* 498, canceled */ |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
399 ngx_null_string, /* 499, client has closed connection */ |
335
d4241d7787fe
nginx-0.0.3-2004-05-14-20:51:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
331
diff
changeset
|
400 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
401 ngx_string(ngx_http_error_500_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
402 ngx_string(ngx_http_error_501_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
403 ngx_string(ngx_http_error_502_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
404 ngx_string(ngx_http_error_503_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
405 ngx_string(ngx_http_error_504_page), |
6993
8801ff7d58e1
Don't pretend we support HTTP major versions >1 as HTTP/1.1.
Ruslan Ermilov <ru@nginx.com>
parents:
6977
diff
changeset
|
406 ngx_string(ngx_http_error_505_page), |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
407 ngx_null_string, /* 506 */ |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
408 ngx_string(ngx_http_error_507_page) |
2696 | 409 |
4490
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
410 #define NGX_HTTP_LAST_5XX 508 |
2696 | 411 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
412 }; |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
413 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
414 |
487 | 415 ngx_int_t |
416 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
|
417 { |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
418 ngx_uint_t i, err; |
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 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
|
420 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
|
421 |
2040
eba265857dc2
fix building by bcc/etc introduced in r2038
Igor Sysoev <igor@sysoev.ru>
parents:
2037
diff
changeset
|
422 ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
5327
6b479db5b52b
Format specifier fixes in error logging.
Sergey Kandaurov <pluknet@nginx.com>
parents:
4935
diff
changeset
|
423 "http special response: %i, \"%V?%V\"", |
2037 | 424 error, &r->uri, &r->args); |
527 | 425 |
677 | 426 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
|
427 |
2019 | 428 if (r->keepalive) { |
68
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
429 switch (error) { |
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
430 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
|
431 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
|
432 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
|
433 case NGX_HTTP_TO_HTTPS: |
647 | 434 case NGX_HTTPS_CERT_ERROR: |
435 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
|
436 case NGX_HTTP_INTERNAL_SERVER_ERROR: |
4920
812c4765c954
Request body: fixed "501 Not Implemented" error handling.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4746
diff
changeset
|
437 case NGX_HTTP_NOT_IMPLEMENTED: |
68
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
438 r->keepalive = 0; |
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
439 } |
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
440 } |
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
441 |
4201
1d52dd2b5bb7
Stylistic change in checking the boolean expression.
Ruslan Ermilov <ru@nginx.com>
parents:
4146
diff
changeset
|
442 if (r->lingering_close) { |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
71
diff
changeset
|
443 switch (error) { |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
71
diff
changeset
|
444 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
|
445 case NGX_HTTP_TO_HTTPS: |
647 | 446 case NGX_HTTPS_CERT_ERROR: |
447 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
|
448 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
|
449 } |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
71
diff
changeset
|
450 } |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
71
diff
changeset
|
451 |
675 | 452 r->headers_out.content_type.len = 0; |
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 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
|
455 |
2174
20a7fc523aec
disable error_page loop in 500 error when recursive errors are enabled
Igor Sysoev <igor@sysoev.ru>
parents:
2040
diff
changeset
|
456 if (!r->error_page && clcf->error_pages && r->uri_changes != 0) { |
679 | 457 |
458 if (clcf->recursive_error_pages == 0) { | |
459 r->error_page = 1; | |
460 } | |
477 | 461 |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
462 err_page = clcf->error_pages->elts; |
477 | 463 |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
464 for (i = 0; i < clcf->error_pages->nelts; i++) { |
326
8733703a37f3
nginx-0.0.3-2004-04-26-00:13:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
323
diff
changeset
|
465 if (err_page[i].status == error) { |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
466 return ngx_http_send_error_page(r, &err_page[i]); |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
467 } |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
468 } |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
469 } |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
470 |
2436
26d9d4a41e91
send "100 Continue" just before reading request body
Igor Sysoev <igor@sysoev.ru>
parents:
2192
diff
changeset
|
471 r->expect_tested = 1; |
26d9d4a41e91
send "100 Continue" just before reading request body
Igor Sysoev <igor@sysoev.ru>
parents:
2192
diff
changeset
|
472 |
2191
808547aa8c12
do not discard body while error_page redirection
Igor Sysoev <igor@sysoev.ru>
parents:
2174
diff
changeset
|
473 if (ngx_http_discard_request_body(r) != NGX_OK) { |
4935
7bd1c839af3b
Request body: improved handling of incorrect chunked request body.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4920
diff
changeset
|
474 r->keepalive = 0; |
2191
808547aa8c12
do not discard body while error_page redirection
Igor Sysoev <igor@sysoev.ru>
parents:
2174
diff
changeset
|
475 } |
808547aa8c12
do not discard body while error_page redirection
Igor Sysoev <igor@sysoev.ru>
parents:
2174
diff
changeset
|
476 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
477 if (clcf->msie_refresh |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
478 && r->headers_in.msie |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
479 && (error == NGX_HTTP_MOVED_PERMANENTLY |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
480 || error == NGX_HTTP_MOVED_TEMPORARILY)) |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
481 { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
482 return ngx_http_send_refresh(r); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
483 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
484 |
633 | 485 if (error == NGX_HTTP_CREATED) { |
486 /* 201 */ | |
487 err = 0; | |
488 | |
489 } else if (error == NGX_HTTP_NO_CONTENT) { | |
511 | 490 /* 204 */ |
491 err = 0; | |
492 | |
2696 | 493 } else if (error >= NGX_HTTP_MOVED_PERMANENTLY |
4490
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
494 && error < NGX_HTTP_LAST_3XX) |
2696 | 495 { |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
496 /* 3XX */ |
4490
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
497 err = error - NGX_HTTP_MOVED_PERMANENTLY + NGX_HTTP_OFF_3XX; |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
498 |
2696 | 499 } else if (error >= NGX_HTTP_BAD_REQUEST |
4490
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
500 && error < NGX_HTTP_LAST_4XX) |
2696 | 501 { |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
502 /* 4XX */ |
4490
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
503 err = error - NGX_HTTP_BAD_REQUEST + NGX_HTTP_OFF_4XX; |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
504 |
3845
11c68a5ed419
rename NGX_HTTP_OWN_CODES to NGX_HTTP_NGINX_CODES
Igor Sysoev <igor@sysoev.ru>
parents:
3781
diff
changeset
|
505 } else if (error >= NGX_HTTP_NGINX_CODES |
4490
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
506 && error < NGX_HTTP_LAST_5XX) |
2696 | 507 { |
335
d4241d7787fe
nginx-0.0.3-2004-05-14-20:51:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
331
diff
changeset
|
508 /* 49X, 5XX */ |
4490
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
509 err = error - NGX_HTTP_NGINX_CODES + NGX_HTTP_OFF_5XX; |
335
d4241d7787fe
nginx-0.0.3-2004-05-14-20:51:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
331
diff
changeset
|
510 switch (error) { |
384
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
511 case NGX_HTTP_TO_HTTPS: |
647 | 512 case NGX_HTTPS_CERT_ERROR: |
513 case NGX_HTTPS_NO_CERT: | |
3848
de59ad6bf557
introduce 494 code "Request Header Too Large"
Igor Sysoev <igor@sysoev.ru>
parents:
3845
diff
changeset
|
514 case NGX_HTTP_REQUEST_HEADER_TOO_LARGE: |
679 | 515 r->err_status = NGX_HTTP_BAD_REQUEST; |
335
d4241d7787fe
nginx-0.0.3-2004-05-14-20:51:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
331
diff
changeset
|
516 } |
2696 | 517 |
518 } else { | |
519 /* unknown code, zero body */ | |
520 err = 0; | |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
521 } |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
522 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
523 return ngx_http_send_special_response(r, clcf, err); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
524 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
525 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
526 |
2787
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
527 ngx_int_t |
2821
26e06e009ced
allow to pass image filter errors via the same location where the filter is set
Igor Sysoev <igor@sysoev.ru>
parents:
2819
diff
changeset
|
528 ngx_http_filter_finalize_request(ngx_http_request_t *r, ngx_module_t *m, |
26e06e009ced
allow to pass image filter errors via the same location where the filter is set
Igor Sysoev <igor@sysoev.ru>
parents:
2819
diff
changeset
|
529 ngx_int_t error) |
2787
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
530 { |
2821
26e06e009ced
allow to pass image filter errors via the same location where the filter is set
Igor Sysoev <igor@sysoev.ru>
parents:
2819
diff
changeset
|
531 void *ctx; |
26e06e009ced
allow to pass image filter errors via the same location where the filter is set
Igor Sysoev <igor@sysoev.ru>
parents:
2819
diff
changeset
|
532 ngx_int_t rc; |
2787
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
533 |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
534 ngx_http_clean_header(r); |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
535 |
2822 | 536 ctx = NULL; |
537 | |
2821
26e06e009ced
allow to pass image filter errors via the same location where the filter is set
Igor Sysoev <igor@sysoev.ru>
parents:
2819
diff
changeset
|
538 if (m) { |
26e06e009ced
allow to pass image filter errors via the same location where the filter is set
Igor Sysoev <igor@sysoev.ru>
parents:
2819
diff
changeset
|
539 ctx = r->ctx[m->ctx_index]; |
26e06e009ced
allow to pass image filter errors via the same location where the filter is set
Igor Sysoev <igor@sysoev.ru>
parents:
2819
diff
changeset
|
540 } |
26e06e009ced
allow to pass image filter errors via the same location where the filter is set
Igor Sysoev <igor@sysoev.ru>
parents:
2819
diff
changeset
|
541 |
2787
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
542 /* clear the modules contexts */ |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
543 ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module); |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
544 |
2821
26e06e009ced
allow to pass image filter errors via the same location where the filter is set
Igor Sysoev <igor@sysoev.ru>
parents:
2819
diff
changeset
|
545 if (m) { |
26e06e009ced
allow to pass image filter errors via the same location where the filter is set
Igor Sysoev <igor@sysoev.ru>
parents:
2819
diff
changeset
|
546 r->ctx[m->ctx_index] = ctx; |
26e06e009ced
allow to pass image filter errors via the same location where the filter is set
Igor Sysoev <igor@sysoev.ru>
parents:
2819
diff
changeset
|
547 } |
26e06e009ced
allow to pass image filter errors via the same location where the filter is set
Igor Sysoev <igor@sysoev.ru>
parents:
2819
diff
changeset
|
548 |
2819
43fe53832da7
handle big responses for "size" and "test" image_filters
Igor Sysoev <igor@sysoev.ru>
parents:
2787
diff
changeset
|
549 r->filter_finalize = 1; |
43fe53832da7
handle big responses for "size" and "test" image_filters
Igor Sysoev <igor@sysoev.ru>
parents:
2787
diff
changeset
|
550 |
2787
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
551 rc = ngx_http_special_response_handler(r, error); |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
552 |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
553 /* NGX_ERROR resets any pending data */ |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
554 |
2819
43fe53832da7
handle big responses for "size" and "test" image_filters
Igor Sysoev <igor@sysoev.ru>
parents:
2787
diff
changeset
|
555 switch (rc) { |
43fe53832da7
handle big responses for "size" and "test" image_filters
Igor Sysoev <igor@sysoev.ru>
parents:
2787
diff
changeset
|
556 |
43fe53832da7
handle big responses for "size" and "test" image_filters
Igor Sysoev <igor@sysoev.ru>
parents:
2787
diff
changeset
|
557 case NGX_OK: |
43fe53832da7
handle big responses for "size" and "test" image_filters
Igor Sysoev <igor@sysoev.ru>
parents:
2787
diff
changeset
|
558 case NGX_DONE: |
43fe53832da7
handle big responses for "size" and "test" image_filters
Igor Sysoev <igor@sysoev.ru>
parents:
2787
diff
changeset
|
559 return NGX_ERROR; |
43fe53832da7
handle big responses for "size" and "test" image_filters
Igor Sysoev <igor@sysoev.ru>
parents:
2787
diff
changeset
|
560 |
43fe53832da7
handle big responses for "size" and "test" image_filters
Igor Sysoev <igor@sysoev.ru>
parents:
2787
diff
changeset
|
561 default: |
43fe53832da7
handle big responses for "size" and "test" image_filters
Igor Sysoev <igor@sysoev.ru>
parents:
2787
diff
changeset
|
562 return rc; |
43fe53832da7
handle big responses for "size" and "test" image_filters
Igor Sysoev <igor@sysoev.ru>
parents:
2787
diff
changeset
|
563 } |
2787
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
564 } |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
565 |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
566 |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
567 void |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
568 ngx_http_clean_header(ngx_http_request_t *r) |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
569 { |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
570 ngx_memzero(&r->headers_out.status, |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
571 sizeof(ngx_http_headers_out_t) |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
572 - offsetof(ngx_http_headers_out_t, status)); |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
573 |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
574 r->headers_out.headers.part.nelts = 0; |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
575 r->headers_out.headers.part.next = NULL; |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
576 r->headers_out.headers.last = &r->headers_out.headers.part; |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
577 |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
578 r->headers_out.content_length_n = -1; |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
579 r->headers_out.last_modified_time = -1; |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
580 } |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
581 |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
582 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
583 static ngx_int_t |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
584 ngx_http_send_error_page(ngx_http_request_t *r, ngx_http_err_page_t *err_page) |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
585 { |
2436
26d9d4a41e91
send "100 Continue" just before reading request body
Igor Sysoev <igor@sysoev.ru>
parents:
2192
diff
changeset
|
586 ngx_int_t overwrite; |
2589
859f6675a553
use complex value in error_page
Igor Sysoev <igor@sysoev.ru>
parents:
2436
diff
changeset
|
587 ngx_str_t uri, args; |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
588 ngx_table_elt_t *location; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
589 ngx_http_core_loc_conf_t *clcf; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
590 |
2436
26d9d4a41e91
send "100 Continue" just before reading request body
Igor Sysoev <igor@sysoev.ru>
parents:
2192
diff
changeset
|
591 overwrite = err_page->overwrite; |
26d9d4a41e91
send "100 Continue" just before reading request body
Igor Sysoev <igor@sysoev.ru>
parents:
2192
diff
changeset
|
592 |
26d9d4a41e91
send "100 Continue" just before reading request body
Igor Sysoev <igor@sysoev.ru>
parents:
2192
diff
changeset
|
593 if (overwrite && overwrite != NGX_HTTP_OK) { |
26d9d4a41e91
send "100 Continue" just before reading request body
Igor Sysoev <igor@sysoev.ru>
parents:
2192
diff
changeset
|
594 r->expect_tested = 1; |
26d9d4a41e91
send "100 Continue" just before reading request body
Igor Sysoev <igor@sysoev.ru>
parents:
2192
diff
changeset
|
595 } |
26d9d4a41e91
send "100 Continue" just before reading request body
Igor Sysoev <igor@sysoev.ru>
parents:
2192
diff
changeset
|
596 |
3781
173a45374a97
allow override redirect status in error_page
Igor Sysoev <igor@sysoev.ru>
parents:
3663
diff
changeset
|
597 if (overwrite >= 0) { |
173a45374a97
allow override redirect status in error_page
Igor Sysoev <igor@sysoev.ru>
parents:
3663
diff
changeset
|
598 r->err_status = overwrite; |
173a45374a97
allow override redirect status in error_page
Igor Sysoev <igor@sysoev.ru>
parents:
3663
diff
changeset
|
599 } |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
600 |
2589
859f6675a553
use complex value in error_page
Igor Sysoev <igor@sysoev.ru>
parents:
2436
diff
changeset
|
601 if (ngx_http_complex_value(r, &err_page->value, &uri) != NGX_OK) { |
859f6675a553
use complex value in error_page
Igor Sysoev <igor@sysoev.ru>
parents:
2436
diff
changeset
|
602 return NGX_ERROR; |
859f6675a553
use complex value in error_page
Igor Sysoev <igor@sysoev.ru>
parents:
2436
diff
changeset
|
603 } |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
604 |
6062
173561dfd567
Fixed invalid access to complex value defined as an empty string.
Sergey Kandaurov <pluknet@nginx.com>
parents:
5327
diff
changeset
|
605 if (uri.len && uri.data[0] == '/') { |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
606 |
2685
6c8a5165ed2a
fix r2590: error_page made an external redirect without query string
Igor Sysoev <igor@sysoev.ru>
parents:
2589
diff
changeset
|
607 if (err_page->value.lengths) { |
6c8a5165ed2a
fix r2590: error_page made an external redirect without query string
Igor Sysoev <igor@sysoev.ru>
parents:
2589
diff
changeset
|
608 ngx_http_split_args(r, &uri, &args); |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
609 |
2685
6c8a5165ed2a
fix r2590: error_page made an external redirect without query string
Igor Sysoev <igor@sysoev.ru>
parents:
2589
diff
changeset
|
610 } else { |
6c8a5165ed2a
fix r2590: error_page made an external redirect without query string
Igor Sysoev <igor@sysoev.ru>
parents:
2589
diff
changeset
|
611 args = err_page->args; |
6c8a5165ed2a
fix r2590: error_page made an external redirect without query string
Igor Sysoev <igor@sysoev.ru>
parents:
2589
diff
changeset
|
612 } |
1922
d23396f2a902
do not change method while error redirection to named location
Igor Sysoev <igor@sysoev.ru>
parents:
1672
diff
changeset
|
613 |
2192
798ecc4fe75c
leave HEAD method while error_page redirection
Igor Sysoev <igor@sysoev.ru>
parents:
2191
diff
changeset
|
614 if (r->method != NGX_HTTP_HEAD) { |
798ecc4fe75c
leave HEAD method while error_page redirection
Igor Sysoev <igor@sysoev.ru>
parents:
2191
diff
changeset
|
615 r->method = NGX_HTTP_GET; |
6310
9d00576252aa
Reduced the number of GET method constants.
Ruslan Ermilov <ru@nginx.com>
parents:
6062
diff
changeset
|
616 r->method_name = ngx_http_core_get_method; |
2192
798ecc4fe75c
leave HEAD method while error_page redirection
Igor Sysoev <igor@sysoev.ru>
parents:
2191
diff
changeset
|
617 } |
1922
d23396f2a902
do not change method while error redirection to named location
Igor Sysoev <igor@sysoev.ru>
parents:
1672
diff
changeset
|
618 |
2589
859f6675a553
use complex value in error_page
Igor Sysoev <igor@sysoev.ru>
parents:
2436
diff
changeset
|
619 return ngx_http_internal_redirect(r, &uri, &args); |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
620 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
621 |
6062
173561dfd567
Fixed invalid access to complex value defined as an empty string.
Sergey Kandaurov <pluknet@nginx.com>
parents:
5327
diff
changeset
|
622 if (uri.len && uri.data[0] == '@') { |
2589
859f6675a553
use complex value in error_page
Igor Sysoev <igor@sysoev.ru>
parents:
2436
diff
changeset
|
623 return ngx_http_named_location(r, &uri); |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
624 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
625 |
7607
d0d6cf5031a3
Discard request body when redirecting to a URL via error_page.
Ruslan Ermilov <ru@nginx.com>
parents:
7358
diff
changeset
|
626 r->expect_tested = 1; |
d0d6cf5031a3
Discard request body when redirecting to a URL via error_page.
Ruslan Ermilov <ru@nginx.com>
parents:
7358
diff
changeset
|
627 |
d0d6cf5031a3
Discard request body when redirecting to a URL via error_page.
Ruslan Ermilov <ru@nginx.com>
parents:
7358
diff
changeset
|
628 if (ngx_http_discard_request_body(r) != NGX_OK) { |
d0d6cf5031a3
Discard request body when redirecting to a URL via error_page.
Ruslan Ermilov <ru@nginx.com>
parents:
7358
diff
changeset
|
629 r->keepalive = 0; |
d0d6cf5031a3
Discard request body when redirecting to a URL via error_page.
Ruslan Ermilov <ru@nginx.com>
parents:
7358
diff
changeset
|
630 } |
d0d6cf5031a3
Discard request body when redirecting to a URL via error_page.
Ruslan Ermilov <ru@nginx.com>
parents:
7358
diff
changeset
|
631 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
632 location = ngx_list_push(&r->headers_out.headers); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
633 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
634 if (location == NULL) { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
635 return NGX_ERROR; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
636 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
637 |
4491
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
638 if (overwrite != NGX_HTTP_MOVED_PERMANENTLY |
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
639 && overwrite != NGX_HTTP_MOVED_TEMPORARILY |
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
640 && overwrite != NGX_HTTP_SEE_OTHER |
6977
be5cfa918bfc
Added support for the "308 Permanent Redirect" (ticket #877).
Simon Leblanc <contact@leblanc-simon.eu>
parents:
6965
diff
changeset
|
641 && overwrite != NGX_HTTP_TEMPORARY_REDIRECT |
be5cfa918bfc
Added support for the "308 Permanent Redirect" (ticket #877).
Simon Leblanc <contact@leblanc-simon.eu>
parents:
6965
diff
changeset
|
642 && overwrite != NGX_HTTP_PERMANENT_REDIRECT) |
3860
39ad979cd31e
fix "error_page 497 https://" case
Igor Sysoev <igor@sysoev.ru>
parents:
3848
diff
changeset
|
643 { |
39ad979cd31e
fix "error_page 497 https://" case
Igor Sysoev <igor@sysoev.ru>
parents:
3848
diff
changeset
|
644 r->err_status = NGX_HTTP_MOVED_TEMPORARILY; |
39ad979cd31e
fix "error_page 497 https://" case
Igor Sysoev <igor@sysoev.ru>
parents:
3848
diff
changeset
|
645 } |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
646 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
647 location->hash = 1; |
3516
dd1570b6f237
ngx_str_set() and ngx_str_null()
Igor Sysoev <igor@sysoev.ru>
parents:
3316
diff
changeset
|
648 ngx_str_set(&location->key, "Location"); |
2589
859f6675a553
use complex value in error_page
Igor Sysoev <igor@sysoev.ru>
parents:
2436
diff
changeset
|
649 location->value = uri; |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
650 |
4206
1a94a56a4e5d
Clear old Location header (if any) while adding a new one.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4201
diff
changeset
|
651 ngx_http_clear_location(r); |
1a94a56a4e5d
Clear old Location header (if any) while adding a new one.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4201
diff
changeset
|
652 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
653 r->headers_out.location = location; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
654 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
655 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
656 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
657 if (clcf->msie_refresh && r->headers_in.msie) { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
658 return ngx_http_send_refresh(r); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
659 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
660 |
3781
173a45374a97
allow override redirect status in error_page
Igor Sysoev <igor@sysoev.ru>
parents:
3663
diff
changeset
|
661 return ngx_http_send_special_response(r, clcf, r->err_status |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
662 - NGX_HTTP_MOVED_PERMANENTLY |
4490
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
663 + NGX_HTTP_OFF_3XX); |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
664 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
665 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
666 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
667 static ngx_int_t |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
668 ngx_http_send_special_response(ngx_http_request_t *r, |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
669 ngx_http_core_loc_conf_t *clcf, ngx_uint_t err) |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
670 { |
6451
155871d773cc
Backed out server_tokens changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6449
diff
changeset
|
671 u_char *tail; |
155871d773cc
Backed out server_tokens changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6449
diff
changeset
|
672 size_t len; |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
673 ngx_int_t rc; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
674 ngx_buf_t *b; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
675 ngx_uint_t msie_padding; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
676 ngx_chain_t out[3]; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
677 |
6885
25203fc377fb
Implemented the "server_tokens build" option.
Ruslan Ermilov <ru@nginx.com>
parents:
6796
diff
changeset
|
678 if (clcf->server_tokens == NGX_HTTP_SERVER_TOKENS_ON) { |
6451
155871d773cc
Backed out server_tokens changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6449
diff
changeset
|
679 len = sizeof(ngx_http_error_full_tail) - 1; |
155871d773cc
Backed out server_tokens changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6449
diff
changeset
|
680 tail = ngx_http_error_full_tail; |
155871d773cc
Backed out server_tokens changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6449
diff
changeset
|
681 |
6885
25203fc377fb
Implemented the "server_tokens build" option.
Ruslan Ermilov <ru@nginx.com>
parents:
6796
diff
changeset
|
682 } else if (clcf->server_tokens == NGX_HTTP_SERVER_TOKENS_BUILD) { |
25203fc377fb
Implemented the "server_tokens build" option.
Ruslan Ermilov <ru@nginx.com>
parents:
6796
diff
changeset
|
683 len = sizeof(ngx_http_error_build_tail) - 1; |
25203fc377fb
Implemented the "server_tokens build" option.
Ruslan Ermilov <ru@nginx.com>
parents:
6796
diff
changeset
|
684 tail = ngx_http_error_build_tail; |
25203fc377fb
Implemented the "server_tokens build" option.
Ruslan Ermilov <ru@nginx.com>
parents:
6796
diff
changeset
|
685 |
6451
155871d773cc
Backed out server_tokens changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6449
diff
changeset
|
686 } else { |
155871d773cc
Backed out server_tokens changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6449
diff
changeset
|
687 len = sizeof(ngx_http_error_tail) - 1; |
155871d773cc
Backed out server_tokens changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6449
diff
changeset
|
688 tail = ngx_http_error_tail; |
155871d773cc
Backed out server_tokens changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6449
diff
changeset
|
689 } |
155871d773cc
Backed out server_tokens changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6449
diff
changeset
|
690 |
356
2e3cbc1bbe3c
nginx-0.0.7-2004-06-16-19:32:11 import
Igor Sysoev <igor@sysoev.ru>
parents:
343
diff
changeset
|
691 msie_padding = 0; |
2e3cbc1bbe3c
nginx-0.0.7-2004-06-16-19:32:11 import
Igor Sysoev <igor@sysoev.ru>
parents:
343
diff
changeset
|
692 |
3663
4a643a230686
remove r->zero_body unused since the previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
3631
diff
changeset
|
693 if (ngx_http_error_pages[err].len) { |
6451
155871d773cc
Backed out server_tokens changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6449
diff
changeset
|
694 r->headers_out.content_length_n = ngx_http_error_pages[err].len + len; |
3663
4a643a230686
remove r->zero_body unused since the previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
3631
diff
changeset
|
695 if (clcf->msie_padding |
4a643a230686
remove r->zero_body unused since the previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
3631
diff
changeset
|
696 && (r->headers_in.msie || r->headers_in.chrome) |
4a643a230686
remove r->zero_body unused since the previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
3631
diff
changeset
|
697 && r->http_version >= NGX_HTTP_VERSION_10 |
4490
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
698 && err >= NGX_HTTP_OFF_4XX) |
3663
4a643a230686
remove r->zero_body unused since the previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
3631
diff
changeset
|
699 { |
4a643a230686
remove r->zero_body unused since the previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
3631
diff
changeset
|
700 r->headers_out.content_length_n += |
4a643a230686
remove r->zero_body unused since the previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
3631
diff
changeset
|
701 sizeof(ngx_http_msie_padding) - 1; |
4a643a230686
remove r->zero_body unused since the previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
3631
diff
changeset
|
702 msie_padding = 1; |
331
f168a88e93f7
nginx-0.0.3-2004-05-04-21:56:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
326
diff
changeset
|
703 } |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
704 |
3663
4a643a230686
remove r->zero_body unused since the previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
3631
diff
changeset
|
705 r->headers_out.content_type_len = sizeof("text/html") - 1; |
4a643a230686
remove r->zero_body unused since the previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
3631
diff
changeset
|
706 ngx_str_set(&r->headers_out.content_type, "text/html"); |
4a643a230686
remove r->zero_body unused since the previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
3631
diff
changeset
|
707 r->headers_out.content_type_lowcase = NULL; |
4a643a230686
remove r->zero_body unused since the previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
3631
diff
changeset
|
708 |
68
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
709 } else { |
4146
55acacac22df
Fix for incorrect 201 replies from dav module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3860
diff
changeset
|
710 r->headers_out.content_length_n = 0; |
165
894a01c6aea3
nginx-0.0.1-2003-10-29-20:39:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
164
diff
changeset
|
711 } |
894a01c6aea3
nginx-0.0.1-2003-10-29-20:39:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
164
diff
changeset
|
712 |
894a01c6aea3
nginx-0.0.1-2003-10-29-20:39:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
164
diff
changeset
|
713 if (r->headers_out.content_length) { |
509 | 714 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
|
715 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
|
716 } |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
717 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
718 ngx_http_clear_accept_ranges(r); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
719 ngx_http_clear_last_modified(r); |
4746
4a18bf1833a9
Entity tags: clear on entity changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4491
diff
changeset
|
720 ngx_http_clear_etag(r); |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
721 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
722 rc = ngx_http_send_header(r); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
723 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
724 if (rc == NGX_ERROR || r->header_only) { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
725 return rc; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
726 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
727 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
728 if (ngx_http_error_pages[err].len == 0) { |
4146
55acacac22df
Fix for incorrect 201 replies from dav module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3860
diff
changeset
|
729 return ngx_http_send_special(r, NGX_HTTP_LAST); |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
730 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
731 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
732 b = ngx_calloc_buf(r->pool); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
733 if (b == NULL) { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
734 return NGX_ERROR; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
735 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
736 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
737 b->memory = 1; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
738 b->pos = ngx_http_error_pages[err].data; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
739 b->last = ngx_http_error_pages[err].data + ngx_http_error_pages[err].len; |
1298
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
740 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
741 out[0].buf = b; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
742 out[0].next = &out[1]; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
743 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
744 b = ngx_calloc_buf(r->pool); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
745 if (b == NULL) { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
746 return NGX_ERROR; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
747 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
748 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
749 b->memory = 1; |
6451
155871d773cc
Backed out server_tokens changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6449
diff
changeset
|
750 |
155871d773cc
Backed out server_tokens changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6449
diff
changeset
|
751 b->pos = tail; |
155871d773cc
Backed out server_tokens changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6449
diff
changeset
|
752 b->last = tail + len; |
1298
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
753 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
754 out[1].buf = b; |
2024 | 755 out[1].next = NULL; |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
756 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
757 if (msie_padding) { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
758 b = ngx_calloc_buf(r->pool); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
759 if (b == NULL) { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
760 return NGX_ERROR; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
761 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
762 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
763 b->memory = 1; |
3316
a63dd08379c4
add MSIE padding for Chrome too
Igor Sysoev <igor@sysoev.ru>
parents:
2882
diff
changeset
|
764 b->pos = ngx_http_msie_padding; |
a63dd08379c4
add MSIE padding for Chrome too
Igor Sysoev <igor@sysoev.ru>
parents:
2882
diff
changeset
|
765 b->last = ngx_http_msie_padding + sizeof(ngx_http_msie_padding) - 1; |
1298
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
766 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
767 out[1].next = &out[2]; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
768 out[2].buf = b; |
2024 | 769 out[2].next = NULL; |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
770 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
771 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
772 if (r == r->main) { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
773 b->last_buf = 1; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
774 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
775 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
776 b->last_in_chain = 1; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
777 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
778 return ngx_http_output_filter(r, &out[0]); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
779 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
780 |
679 | 781 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
782 static ngx_int_t |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
783 ngx_http_send_refresh(ngx_http_request_t *r) |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
784 { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
785 u_char *p, *location; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
786 size_t len, size; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
787 uintptr_t escape; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
788 ngx_int_t rc; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
789 ngx_buf_t *b; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
790 ngx_chain_t out; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
791 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
792 len = r->headers_out.location->value.len; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
793 location = r->headers_out.location->value.data; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
794 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
795 escape = 2 * ngx_escape_uri(NULL, location, len, NGX_ESCAPE_REFRESH); |
1298
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
796 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
797 size = sizeof(ngx_http_msie_refresh_head) - 1 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
798 + escape + len |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
799 + sizeof(ngx_http_msie_refresh_tail) - 1; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
800 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
801 r->err_status = NGX_HTTP_OK; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
802 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
803 r->headers_out.content_type_len = sizeof("text/html") - 1; |
3516
dd1570b6f237
ngx_str_set() and ngx_str_null()
Igor Sysoev <igor@sysoev.ru>
parents:
3316
diff
changeset
|
804 ngx_str_set(&r->headers_out.content_type, "text/html"); |
2882
896db5a09bd2
reset content_type hash value, this fixes a bug when XSLT responses
Igor Sysoev <igor@sysoev.ru>
parents:
2822
diff
changeset
|
805 r->headers_out.content_type_lowcase = NULL; |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
806 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
807 r->headers_out.location->hash = 0; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
808 r->headers_out.location = NULL; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
809 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
810 r->headers_out.content_length_n = size; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
811 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
812 if (r->headers_out.content_length) { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
813 r->headers_out.content_length->hash = 0; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
814 r->headers_out.content_length = NULL; |
679 | 815 } |
816 | |
577 | 817 ngx_http_clear_accept_ranges(r); |
818 ngx_http_clear_last_modified(r); | |
4746
4a18bf1833a9
Entity tags: clear on entity changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4491
diff
changeset
|
819 ngx_http_clear_etag(r); |
577 | 820 |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
821 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
|
822 |
143
5526213be452
nginx-0.0.1-2003-10-10-19:10:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
142
diff
changeset
|
823 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
|
824 return rc; |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
825 } |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
826 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
827 b = ngx_create_temp_buf(r->pool, size); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
828 if (b == NULL) { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
829 return NGX_ERROR; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
830 } |
1592 | 831 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
832 p = ngx_cpymem(b->pos, ngx_http_msie_refresh_head, |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
833 sizeof(ngx_http_msie_refresh_head) - 1); |
679 | 834 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
835 if (escape == 0) { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
836 p = ngx_cpymem(p, location, len); |
679 | 837 |
838 } else { | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
839 p = (u_char *) ngx_escape_uri(p, location, len, NGX_ESCAPE_REFRESH); |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
840 } |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
841 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
842 b->last = ngx_cpymem(p, ngx_http_msie_refresh_tail, |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
843 sizeof(ngx_http_msie_refresh_tail) - 1); |
509 | 844 |
6722
6136a51f9c21
Do not set last_buf flag in subrequests.
Roman Arutyunyan <arut@nginx.com>
parents:
6556
diff
changeset
|
845 b->last_buf = (r == r->main) ? 1 : 0; |
509 | 846 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
|
847 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
848 out.buf = b; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
849 out.next = NULL; |
501 | 850 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
851 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
|
852 } |