Mercurial > hg > nginx-quic
annotate src/http/ngx_http_upstream.h @ 4124:0c30976f5bfa
Upstream: Connection header processing.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 15 Sep 2011 19:21:19 +0000 |
parents | 0ee350b5177c |
children | cf6a3467b5db |
rev | line source |
---|---|
479 | 1 |
2 /* | |
3 * Copyright (C) Igor Sysoev | |
4 */ | |
5 | |
6 | |
7 #ifndef _NGX_HTTP_UPSTREAM_H_INCLUDED_ | |
8 #define _NGX_HTTP_UPSTREAM_H_INCLUDED_ | |
9 | |
10 | |
11 #include <ngx_config.h> | |
12 #include <ngx_core.h> | |
13 #include <ngx_event.h> | |
14 #include <ngx_event_connect.h> | |
15 #include <ngx_event_pipe.h> | |
16 #include <ngx_http.h> | |
17 | |
18 | |
665 | 19 #define NGX_HTTP_UPSTREAM_FT_ERROR 0x00000002 |
20 #define NGX_HTTP_UPSTREAM_FT_TIMEOUT 0x00000004 | |
21 #define NGX_HTTP_UPSTREAM_FT_INVALID_HEADER 0x00000008 | |
22 #define NGX_HTTP_UPSTREAM_FT_HTTP_500 0x00000010 | |
2268
33556140681a
*) ngx_http_upstream_test_next()
Igor Sysoev <igor@sysoev.ru>
parents:
2184
diff
changeset
|
23 #define NGX_HTTP_UPSTREAM_FT_HTTP_502 0x00000020 |
33556140681a
*) ngx_http_upstream_test_next()
Igor Sysoev <igor@sysoev.ru>
parents:
2184
diff
changeset
|
24 #define NGX_HTTP_UPSTREAM_FT_HTTP_503 0x00000040 |
33556140681a
*) ngx_http_upstream_test_next()
Igor Sysoev <igor@sysoev.ru>
parents:
2184
diff
changeset
|
25 #define NGX_HTTP_UPSTREAM_FT_HTTP_504 0x00000080 |
33556140681a
*) ngx_http_upstream_test_next()
Igor Sysoev <igor@sysoev.ru>
parents:
2184
diff
changeset
|
26 #define NGX_HTTP_UPSTREAM_FT_HTTP_404 0x00000100 |
2927
55ceaef03d34
proxy_cache_use_stale/fastcgi_cache_use_stale updating
Igor Sysoev <igor@sysoev.ru>
parents:
2875
diff
changeset
|
27 #define NGX_HTTP_UPSTREAM_FT_UPDATING 0x00000200 |
55ceaef03d34
proxy_cache_use_stale/fastcgi_cache_use_stale updating
Igor Sysoev <igor@sysoev.ru>
parents:
2875
diff
changeset
|
28 #define NGX_HTTP_UPSTREAM_FT_BUSY_LOCK 0x00000400 |
55ceaef03d34
proxy_cache_use_stale/fastcgi_cache_use_stale updating
Igor Sysoev <igor@sysoev.ru>
parents:
2875
diff
changeset
|
29 #define NGX_HTTP_UPSTREAM_FT_MAX_WAITING 0x00000800 |
1378 | 30 #define NGX_HTTP_UPSTREAM_FT_NOLIVE 0x40000000 |
665 | 31 #define NGX_HTTP_UPSTREAM_FT_OFF 0x80000000 |
479 | 32 |
2268
33556140681a
*) ngx_http_upstream_test_next()
Igor Sysoev <igor@sysoev.ru>
parents:
2184
diff
changeset
|
33 #define NGX_HTTP_UPSTREAM_FT_STATUS (NGX_HTTP_UPSTREAM_FT_HTTP_500 \ |
33556140681a
*) ngx_http_upstream_test_next()
Igor Sysoev <igor@sysoev.ru>
parents:
2184
diff
changeset
|
34 |NGX_HTTP_UPSTREAM_FT_HTTP_502 \ |
33556140681a
*) ngx_http_upstream_test_next()
Igor Sysoev <igor@sysoev.ru>
parents:
2184
diff
changeset
|
35 |NGX_HTTP_UPSTREAM_FT_HTTP_503 \ |
33556140681a
*) ngx_http_upstream_test_next()
Igor Sysoev <igor@sysoev.ru>
parents:
2184
diff
changeset
|
36 |NGX_HTTP_UPSTREAM_FT_HTTP_504 \ |
33556140681a
*) ngx_http_upstream_test_next()
Igor Sysoev <igor@sysoev.ru>
parents:
2184
diff
changeset
|
37 |NGX_HTTP_UPSTREAM_FT_HTTP_404) |
479 | 38 |
39 #define NGX_HTTP_UPSTREAM_INVALID_HEADER 40 | |
40 | |
41 | |
2786
4e002555652d
proxy_ignore_headers and fastcgi_ignore_headers
Igor Sysoev <igor@sysoev.ru>
parents:
2754
diff
changeset
|
42 #define NGX_HTTP_UPSTREAM_IGN_XA_REDIRECT 0x00000002 |
4e002555652d
proxy_ignore_headers and fastcgi_ignore_headers
Igor Sysoev <igor@sysoev.ru>
parents:
2754
diff
changeset
|
43 #define NGX_HTTP_UPSTREAM_IGN_XA_EXPIRES 0x00000004 |
4e002555652d
proxy_ignore_headers and fastcgi_ignore_headers
Igor Sysoev <igor@sysoev.ru>
parents:
2754
diff
changeset
|
44 #define NGX_HTTP_UPSTREAM_IGN_EXPIRES 0x00000008 |
4e002555652d
proxy_ignore_headers and fastcgi_ignore_headers
Igor Sysoev <igor@sysoev.ru>
parents:
2754
diff
changeset
|
45 #define NGX_HTTP_UPSTREAM_IGN_CACHE_CONTROL 0x00000010 |
3669
1f5841b1fcd7
treat Set-Cookie as a header that forbids caching
Igor Sysoev <igor@sysoev.ru>
parents:
3667
diff
changeset
|
46 #define NGX_HTTP_UPSTREAM_IGN_SET_COOKIE 0x00000020 |
2786
4e002555652d
proxy_ignore_headers and fastcgi_ignore_headers
Igor Sysoev <igor@sysoev.ru>
parents:
2754
diff
changeset
|
47 |
4e002555652d
proxy_ignore_headers and fastcgi_ignore_headers
Igor Sysoev <igor@sysoev.ru>
parents:
2754
diff
changeset
|
48 |
479 | 49 typedef struct { |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
50 ngx_msec_t bl_time; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
51 ngx_uint_t bl_state; |
479 | 52 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
53 ngx_uint_t status; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
54 time_t response_sec; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
55 ngx_uint_t response_msec; |
3795 | 56 off_t response_length; |
563 | 57 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
58 ngx_str_t *peer; |
479 | 59 } ngx_http_upstream_state_t; |
60 | |
61 | |
62 typedef struct { | |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
63 ngx_hash_t headers_in_hash; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
64 ngx_array_t upstreams; |
884 | 65 /* ngx_http_upstream_srv_conf_t */ |
509 | 66 } ngx_http_upstream_main_conf_t; |
67 | |
884 | 68 typedef struct ngx_http_upstream_srv_conf_s ngx_http_upstream_srv_conf_t; |
69 | |
70 typedef ngx_int_t (*ngx_http_upstream_init_pt)(ngx_conf_t *cf, | |
71 ngx_http_upstream_srv_conf_t *us); | |
72 typedef ngx_int_t (*ngx_http_upstream_init_peer_pt)(ngx_http_request_t *r, | |
73 ngx_http_upstream_srv_conf_t *us); | |
74 | |
75 | |
76 typedef struct { | |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
77 ngx_http_upstream_init_pt init_upstream; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
78 ngx_http_upstream_init_peer_pt init; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
79 void *data; |
884 | 80 } ngx_http_upstream_peer_t; |
81 | |
509 | 82 |
83 typedef struct { | |
3269
f0d596e84634
rename ngx_peer_addr_t to ngx_addr_t
Igor Sysoev <igor@sysoev.ru>
parents:
3264
diff
changeset
|
84 ngx_addr_t *addrs; |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
85 ngx_uint_t naddrs; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
86 ngx_uint_t weight; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
87 ngx_uint_t max_fails; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
88 time_t fail_timeout; |
884 | 89 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
90 unsigned down:1; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
91 unsigned backup:1; |
884 | 92 } ngx_http_upstream_server_t; |
93 | |
651 | 94 |
884 | 95 #define NGX_HTTP_UPSTREAM_CREATE 0x0001 |
96 #define NGX_HTTP_UPSTREAM_WEIGHT 0x0002 | |
97 #define NGX_HTTP_UPSTREAM_MAX_FAILS 0x0004 | |
98 #define NGX_HTTP_UPSTREAM_FAIL_TIMEOUT 0x0008 | |
99 #define NGX_HTTP_UPSTREAM_DOWN 0x0010 | |
100 #define NGX_HTTP_UPSTREAM_BACKUP 0x0020 | |
101 | |
651 | 102 |
884 | 103 struct ngx_http_upstream_srv_conf_s { |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
104 ngx_http_upstream_peer_t peer; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
105 void **srv_conf; |
884 | 106 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
107 ngx_array_t *servers; /* ngx_http_upstream_server_t */ |
884 | 108 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
109 ngx_uint_t flags; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
110 ngx_str_t host; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
111 u_char *file_name; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
112 ngx_uint_t line; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
113 in_port_t port; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
114 in_port_t default_port; |
884 | 115 }; |
651 | 116 |
117 | |
118 typedef struct { | |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
119 ngx_http_upstream_srv_conf_t *upstream; |
884 | 120 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
121 ngx_msec_t connect_timeout; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
122 ngx_msec_t send_timeout; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
123 ngx_msec_t read_timeout; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
124 ngx_msec_t timeout; |
479 | 125 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
126 size_t send_lowat; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
127 size_t buffer_size; |
529 | 128 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
129 size_t busy_buffers_size; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
130 size_t max_temp_file_size; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
131 size_t temp_file_write_size; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
132 |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
133 size_t busy_buffers_size_conf; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
134 size_t max_temp_file_size_conf; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
135 size_t temp_file_write_size_conf; |
509 | 136 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
137 ngx_bufs_t bufs; |
529 | 138 |
2786
4e002555652d
proxy_ignore_headers and fastcgi_ignore_headers
Igor Sysoev <igor@sysoev.ru>
parents:
2754
diff
changeset
|
139 ngx_uint_t ignore_headers; |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
140 ngx_uint_t next_upstream; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
141 ngx_uint_t store_access; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
142 ngx_flag_t buffering; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
143 ngx_flag_t pass_request_headers; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
144 ngx_flag_t pass_request_body; |
479 | 145 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
146 ngx_flag_t ignore_client_abort; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
147 ngx_flag_t intercept_errors; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
148 ngx_flag_t cyclic_temp_file; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
149 |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
150 ngx_path_t *temp_path; |
479 | 151 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
152 ngx_hash_t hide_headers_hash; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
153 ngx_array_t *hide_headers; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
154 ngx_array_t *pass_headers; |
509 | 155 |
3271
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
3269
diff
changeset
|
156 ngx_addr_t *local; |
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
3269
diff
changeset
|
157 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
158 #if (NGX_HTTP_CACHE) |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
159 ngx_shm_zone_t *cache; |
479 | 160 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
161 ngx_uint_t cache_min_uses; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
162 ngx_uint_t cache_use_stale; |
2875
6e1941b321b7
proxy_cache_methods and fastcgi_cache_methods
Igor Sysoev <igor@sysoev.ru>
parents:
2786
diff
changeset
|
163 ngx_uint_t cache_methods; |
479 | 164 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
165 ngx_array_t *cache_valid; |
3699
b0a0686a85bb
proxy_cache_pass, fastcgi_cache_bypass, uwsgi_cache_bypass, scgi_cache_bypass
Igor Sysoev <igor@sysoev.ru>
parents:
3669
diff
changeset
|
166 ngx_array_t *cache_bypass; |
b0a0686a85bb
proxy_cache_pass, fastcgi_cache_bypass, uwsgi_cache_bypass, scgi_cache_bypass
Igor Sysoev <igor@sysoev.ru>
parents:
3669
diff
changeset
|
167 ngx_array_t *no_cache; |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
168 #endif |
509 | 169 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
170 ngx_array_t *store_lengths; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
171 ngx_array_t *store_values; |
1295
5383f5232364
proxy_store and fastcgi_store were changed,
Igor Sysoev <igor@sysoev.ru>
parents:
1291
diff
changeset
|
172 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
173 signed store:2; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
174 unsigned intercept_404:1; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
175 unsigned change_buffering:1; |
581 | 176 |
577 | 177 #if (NGX_HTTP_SSL) |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
178 ngx_ssl_t *ssl; |
2754 | 179 ngx_flag_t ssl_session_reuse; |
577 | 180 #endif |
181 | |
3976
215fe9223419
update r3945 with more descriptive error message
Igor Sysoev <igor@sysoev.ru>
parents:
3795
diff
changeset
|
182 ngx_str_t module; |
479 | 183 } ngx_http_upstream_conf_t; |
184 | |
185 | |
509 | 186 typedef struct { |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
187 ngx_str_t name; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
188 ngx_http_header_handler_pt handler; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
189 ngx_uint_t offset; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
190 ngx_http_header_handler_pt copy_handler; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
191 ngx_uint_t conf; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
192 ngx_uint_t redirect; /* unsigned redirect:1; */ |
509 | 193 } ngx_http_upstream_header_t; |
194 | |
195 | |
196 typedef struct { | |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
197 ngx_list_t headers; |
509 | 198 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
199 ngx_uint_t status_n; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
200 ngx_str_t status_line; |
529 | 201 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
202 ngx_table_elt_t *status; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
203 ngx_table_elt_t *date; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
204 ngx_table_elt_t *server; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
205 ngx_table_elt_t *connection; |
509 | 206 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
207 ngx_table_elt_t *expires; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
208 ngx_table_elt_t *etag; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
209 ngx_table_elt_t *x_accel_expires; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
210 ngx_table_elt_t *x_accel_redirect; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
211 ngx_table_elt_t *x_accel_limit_rate; |
509 | 212 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
213 ngx_table_elt_t *content_type; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
214 ngx_table_elt_t *content_length; |
509 | 215 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
216 ngx_table_elt_t *last_modified; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
217 ngx_table_elt_t *location; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
218 ngx_table_elt_t *accept_ranges; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
219 ngx_table_elt_t *www_authenticate; |
4123
0ee350b5177c
Upstream: Transfer-Encoding header processing.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4120
diff
changeset
|
220 ngx_table_elt_t *transfer_encoding; |
509 | 221 |
222 #if (NGX_HTTP_GZIP) | |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
223 ngx_table_elt_t *content_encoding; |
509 | 224 #endif |
225 | |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
226 off_t content_length_n; |
1885
e5897822515f
test response length in proxy/fastcgi_store
Igor Sysoev <igor@sysoev.ru>
parents:
1701
diff
changeset
|
227 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
228 ngx_array_t cache_control; |
4123
0ee350b5177c
Upstream: Transfer-Encoding header processing.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4120
diff
changeset
|
229 |
4124
0c30976f5bfa
Upstream: Connection header processing.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4123
diff
changeset
|
230 unsigned connection_close:1; |
4123
0ee350b5177c
Upstream: Transfer-Encoding header processing.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4120
diff
changeset
|
231 unsigned chunked:1; |
509 | 232 } ngx_http_upstream_headers_in_t; |
233 | |
479 | 234 |
1658 | 235 typedef struct { |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
236 ngx_str_t host; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
237 in_port_t port; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
238 ngx_uint_t no_port; /* unsigned no_port:1 */ |
2422
7af1e5fe102c
variable support for unix sockets in fastcgi_pass and proxy_pass
Igor Sysoev <igor@sysoev.ru>
parents:
2402
diff
changeset
|
239 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
240 ngx_uint_t naddrs; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
241 in_addr_t *addrs; |
2422
7af1e5fe102c
variable support for unix sockets in fastcgi_pass and proxy_pass
Igor Sysoev <igor@sysoev.ru>
parents:
2402
diff
changeset
|
242 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
243 struct sockaddr *sockaddr; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
244 socklen_t socklen; |
2422
7af1e5fe102c
variable support for unix sockets in fastcgi_pass and proxy_pass
Igor Sysoev <igor@sysoev.ru>
parents:
2402
diff
changeset
|
245 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
246 ngx_resolver_ctx_t *ctx; |
1658 | 247 } ngx_http_upstream_resolved_t; |
248 | |
249 | |
2386
4ccaa42de633
use already available r and u instead of ev
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
250 typedef void (*ngx_http_upstream_handler_pt)(ngx_http_request_t *r, |
4ccaa42de633
use already available r and u instead of ev
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
251 ngx_http_upstream_t *u); |
4ccaa42de633
use already available r and u instead of ev
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
252 |
4ccaa42de633
use already available r and u instead of ev
Igor Sysoev <igor@sysoev.ru>
parents:
2377
diff
changeset
|
253 |
479 | 254 struct ngx_http_upstream_s { |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
255 ngx_http_upstream_handler_pt read_event_handler; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
256 ngx_http_upstream_handler_pt write_event_handler; |
2377
87b8c44906b5
*) refactor subrequest handling, now they run as separate posted requests
Igor Sysoev <igor@sysoev.ru>
parents:
2285
diff
changeset
|
257 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
258 ngx_peer_connection_t peer; |
479 | 259 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
260 ngx_event_pipe_t *pipe; |
479 | 261 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
262 ngx_chain_t *request_bufs; |
479 | 263 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
264 ngx_output_chain_ctx_t output; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
265 ngx_chain_writer_ctx_t writer; |
479 | 266 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
267 ngx_http_upstream_conf_t *conf; |
479 | 268 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
269 ngx_http_upstream_headers_in_t headers_in; |
509 | 270 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
271 ngx_http_upstream_resolved_t *resolved; |
1658 | 272 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
273 ngx_buf_t buffer; |
4118
dbddec65fdab
Upstream: r->upstream->length type change to off_t.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3976
diff
changeset
|
274 off_t length; |
581 | 275 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
276 ngx_chain_t *out_bufs; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
277 ngx_chain_t *busy_bufs; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
278 ngx_chain_t *free_bufs; |
581 | 279 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
280 ngx_int_t (*input_filter_init)(void *data); |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
281 ngx_int_t (*input_filter)(void *data, ssize_t bytes); |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
282 void *input_filter_ctx; |
479 | 283 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
284 #if (NGX_HTTP_CACHE) |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
285 ngx_int_t (*create_key)(ngx_http_request_t *r); |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
286 #endif |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
287 ngx_int_t (*create_request)(ngx_http_request_t *r); |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
288 ngx_int_t (*reinit_request)(ngx_http_request_t *r); |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
289 ngx_int_t (*process_header)(ngx_http_request_t *r); |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
290 void (*abort_request)(ngx_http_request_t *r); |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
291 void (*finalize_request)(ngx_http_request_t *r, |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
292 ngx_int_t rc); |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
293 ngx_int_t (*rewrite_redirect)(ngx_http_request_t *r, |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
294 ngx_table_elt_t *h, size_t prefix); |
479 | 295 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
296 ngx_msec_t timeout; |
527 | 297 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
298 ngx_http_upstream_state_t *state; |
479 | 299 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
300 ngx_str_t method; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
301 ngx_str_t schema; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
302 ngx_str_t uri; |
555 | 303 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
304 ngx_http_cleanup_pt *cleanup; |
569 | 305 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
306 unsigned store:1; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
307 unsigned cacheable:1; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
308 unsigned accel:1; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
309 unsigned ssl:1; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
310 #if (NGX_HTTP_CACHE) |
2952 | 311 unsigned cache_status:3; |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
312 #endif |
479 | 313 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
314 unsigned buffering:1; |
4120
42135dd1f0ea
Upstream: keepalive flag.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4118
diff
changeset
|
315 unsigned keepalive:1; |
649 | 316 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
317 unsigned request_sent:1; |
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2422
diff
changeset
|
318 unsigned header_sent:1; |
479 | 319 }; |
320 | |
321 | |
2268
33556140681a
*) ngx_http_upstream_test_next()
Igor Sysoev <igor@sysoev.ru>
parents:
2184
diff
changeset
|
322 typedef struct { |
33556140681a
*) ngx_http_upstream_test_next()
Igor Sysoev <igor@sysoev.ru>
parents:
2184
diff
changeset
|
323 ngx_uint_t status; |
33556140681a
*) ngx_http_upstream_test_next()
Igor Sysoev <igor@sysoev.ru>
parents:
2184
diff
changeset
|
324 ngx_uint_t mask; |
33556140681a
*) ngx_http_upstream_test_next()
Igor Sysoev <igor@sysoev.ru>
parents:
2184
diff
changeset
|
325 } ngx_http_upstream_next_t; |
33556140681a
*) ngx_http_upstream_test_next()
Igor Sysoev <igor@sysoev.ru>
parents:
2184
diff
changeset
|
326 |
33556140681a
*) ngx_http_upstream_test_next()
Igor Sysoev <igor@sysoev.ru>
parents:
2184
diff
changeset
|
327 |
1162 | 328 ngx_int_t ngx_http_upstream_header_variable(ngx_http_request_t *r, |
329 ngx_http_variable_value_t *v, uintptr_t data); | |
330 | |
3006
95972b9e790b
ngx_http_upstream_create() to cleanup the previous upstream after
Igor Sysoev <igor@sysoev.ru>
parents:
2952
diff
changeset
|
331 ngx_int_t ngx_http_upstream_create(ngx_http_request_t *r); |
479 | 332 void ngx_http_upstream_init(ngx_http_request_t *r); |
651 | 333 ngx_http_upstream_srv_conf_t *ngx_http_upstream_add(ngx_conf_t *cf, |
884 | 334 ngx_url_t *u, ngx_uint_t flags); |
3399 | 335 char *ngx_http_upstream_bind_set_slot(ngx_conf_t *cf, ngx_command_t *cmd, |
3271
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
3269
diff
changeset
|
336 void *conf); |
1701
40d004d95d88
*) now ngx_conf_set_str_array_slot() tests NGX_CONF_UNSET_PTR
Igor Sysoev <igor@sysoev.ru>
parents:
1658
diff
changeset
|
337 ngx_int_t ngx_http_upstream_hide_headers_hash(ngx_conf_t *cf, |
40d004d95d88
*) now ngx_conf_set_str_array_slot() tests NGX_CONF_UNSET_PTR
Igor Sysoev <igor@sysoev.ru>
parents:
1658
diff
changeset
|
338 ngx_http_upstream_conf_t *conf, ngx_http_upstream_conf_t *prev, |
40d004d95d88
*) now ngx_conf_set_str_array_slot() tests NGX_CONF_UNSET_PTR
Igor Sysoev <igor@sysoev.ru>
parents:
1658
diff
changeset
|
339 ngx_str_t *default_hide_headers, ngx_hash_init_t *hash); |
884 | 340 |
341 | |
342 #define ngx_http_conf_upstream_srv_conf(uscf, module) \ | |
343 uscf->srv_conf[module.ctx_index] | |
509 | 344 |
479 | 345 |
2875
6e1941b321b7
proxy_cache_methods and fastcgi_cache_methods
Igor Sysoev <igor@sysoev.ru>
parents:
2786
diff
changeset
|
346 extern ngx_module_t ngx_http_upstream_module; |
6e1941b321b7
proxy_cache_methods and fastcgi_cache_methods
Igor Sysoev <igor@sysoev.ru>
parents:
2786
diff
changeset
|
347 extern ngx_conf_bitmask_t ngx_http_upstream_cache_method_mask[]; |
3667
12bd9e26fadb
use shared ngx_http_upstream_ignore_headers_masks[]
Igor Sysoev <igor@sysoev.ru>
parents:
3526
diff
changeset
|
348 extern ngx_conf_bitmask_t ngx_http_upstream_ignore_headers_masks[]; |
2875
6e1941b321b7
proxy_cache_methods and fastcgi_cache_methods
Igor Sysoev <igor@sysoev.ru>
parents:
2786
diff
changeset
|
349 |
479 | 350 |
351 #endif /* _NGX_HTTP_UPSTREAM_H_INCLUDED_ */ |