Mercurial > hg > nginx
annotate src/http/modules/ngx_http_uwsgi_module.c @ 5907:195561ef367f
Upstream: moved header initializations to separate functions.
No functional changes.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Wed, 19 Nov 2014 17:33:21 +0300 |
parents | 2f7e557eab5b |
children | f8e80f8c7fc7 |
rev | line source |
---|---|
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
2 /* |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
3 * Copyright (C) Unbit S.a.s. 2009-2010 |
3544 | 4 * Copyright (C) 2008 Manlio Perillo (manlio.perillo@gmail.com) |
5 * Copyright (C) Igor Sysoev | |
4412 | 6 * Copyright (C) Nginx, Inc. |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
7 */ |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
8 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
9 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
10 #include <ngx_config.h> |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
11 #include <ngx_core.h> |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
12 #include <ngx_http.h> |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
13 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
14 |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
15 typedef struct { |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
16 ngx_http_upstream_conf_t upstream; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
17 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
18 ngx_array_t *flushes; |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
19 ngx_array_t *params_len; |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
20 ngx_array_t *params; |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
21 ngx_array_t *params_source; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
22 |
3566
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
23 ngx_hash_t headers_hash; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
24 ngx_uint_t header_params; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
25 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
26 ngx_array_t *uwsgi_lengths; |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
27 ngx_array_t *uwsgi_values; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
28 |
3568 | 29 #if (NGX_HTTP_CACHE) |
30 ngx_http_complex_value_t cache_key; | |
31 #endif | |
32 | |
3550 | 33 ngx_str_t uwsgi_string; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
34 |
3552
40eba0271b1d
improve uwsgi_modifierX processing:
Igor Sysoev <igor@sysoev.ru>
parents:
3551
diff
changeset
|
35 ngx_uint_t modifier1; |
40eba0271b1d
improve uwsgi_modifierX processing:
Igor Sysoev <igor@sysoev.ru>
parents:
3551
diff
changeset
|
36 ngx_uint_t modifier2; |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
37 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
38 #if (NGX_HTTP_SSL) |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
39 ngx_uint_t ssl; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
40 ngx_uint_t ssl_protocols; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
41 ngx_str_t ssl_ciphers; |
5662
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
42 ngx_uint_t ssl_verify_depth; |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
43 ngx_str_t ssl_trusted_certificate; |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
44 ngx_str_t ssl_crl; |
5900
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
45 ngx_str_t ssl_certificate; |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
46 ngx_str_t ssl_certificate_key; |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
47 ngx_array_t *ssl_passwords; |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
48 #endif |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
49 } ngx_http_uwsgi_loc_conf_t; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
50 |
3556 | 51 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
52 static ngx_int_t ngx_http_uwsgi_eval(ngx_http_request_t *r, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
53 ngx_http_uwsgi_loc_conf_t *uwcf); |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
54 static ngx_int_t ngx_http_uwsgi_create_request(ngx_http_request_t *r); |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
55 static ngx_int_t ngx_http_uwsgi_reinit_request(ngx_http_request_t *r); |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
56 static ngx_int_t ngx_http_uwsgi_process_status_line(ngx_http_request_t *r); |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
57 static ngx_int_t ngx_http_uwsgi_process_header(ngx_http_request_t *r); |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
58 static void ngx_http_uwsgi_abort_request(ngx_http_request_t *r); |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
59 static void ngx_http_uwsgi_finalize_request(ngx_http_request_t *r, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
60 ngx_int_t rc); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
61 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
62 static void *ngx_http_uwsgi_create_loc_conf(ngx_conf_t *cf); |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
63 static char *ngx_http_uwsgi_merge_loc_conf(ngx_conf_t *cf, void *parent, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
64 void *child); |
5907
195561ef367f
Upstream: moved header initializations to separate functions.
Roman Arutyunyan <arut@nginx.com>
parents:
5905
diff
changeset
|
65 static ngx_int_t ngx_http_uwsgi_init_params(ngx_conf_t *cf, |
195561ef367f
Upstream: moved header initializations to separate functions.
Roman Arutyunyan <arut@nginx.com>
parents:
5905
diff
changeset
|
66 ngx_http_uwsgi_loc_conf_t *conf); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
67 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
68 static char *ngx_http_uwsgi_pass(ngx_conf_t *cf, ngx_command_t *cmd, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
69 void *conf); |
3565 | 70 static char *ngx_http_uwsgi_store(ngx_conf_t *cf, ngx_command_t *cmd, |
71 void *conf); | |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
72 |
3568 | 73 #if (NGX_HTTP_CACHE) |
74 static ngx_int_t ngx_http_uwsgi_create_key(ngx_http_request_t *r); | |
75 static char *ngx_http_uwsgi_cache(ngx_conf_t *cf, ngx_command_t *cmd, | |
76 void *conf); | |
77 static char *ngx_http_uwsgi_cache_key(ngx_conf_t *cf, ngx_command_t *cmd, | |
78 void *conf); | |
79 #endif | |
80 | |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
81 #if (NGX_HTTP_SSL) |
5900
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
82 static char *ngx_http_uwsgi_ssl_password_file(ngx_conf_t *cf, |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
83 ngx_command_t *cmd, void *conf); |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
84 static ngx_int_t ngx_http_uwsgi_set_ssl(ngx_conf_t *cf, |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
85 ngx_http_uwsgi_loc_conf_t *uwcf); |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
86 #endif |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
87 |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
88 |
3552
40eba0271b1d
improve uwsgi_modifierX processing:
Igor Sysoev <igor@sysoev.ru>
parents:
3551
diff
changeset
|
89 static ngx_conf_num_bounds_t ngx_http_uwsgi_modifier_bounds = { |
40eba0271b1d
improve uwsgi_modifierX processing:
Igor Sysoev <igor@sysoev.ru>
parents:
3551
diff
changeset
|
90 ngx_conf_check_num_bounds, 0, 255 |
40eba0271b1d
improve uwsgi_modifierX processing:
Igor Sysoev <igor@sysoev.ru>
parents:
3551
diff
changeset
|
91 }; |
40eba0271b1d
improve uwsgi_modifierX processing:
Igor Sysoev <igor@sysoev.ru>
parents:
3551
diff
changeset
|
92 |
40eba0271b1d
improve uwsgi_modifierX processing:
Igor Sysoev <igor@sysoev.ru>
parents:
3551
diff
changeset
|
93 |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
94 static ngx_conf_bitmask_t ngx_http_uwsgi_next_upstream_masks[] = { |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
95 { ngx_string("error"), NGX_HTTP_UPSTREAM_FT_ERROR }, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
96 { ngx_string("timeout"), NGX_HTTP_UPSTREAM_FT_TIMEOUT }, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
97 { ngx_string("invalid_header"), NGX_HTTP_UPSTREAM_FT_INVALID_HEADER }, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
98 { ngx_string("http_500"), NGX_HTTP_UPSTREAM_FT_HTTP_500 }, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
99 { ngx_string("http_503"), NGX_HTTP_UPSTREAM_FT_HTTP_503 }, |
5231
05c53652e7b4
Upstream: http_403 support in proxy_next_upstream (and friends).
Maxim Dounin <mdounin@mdounin.ru>
parents:
5080
diff
changeset
|
100 { ngx_string("http_403"), NGX_HTTP_UPSTREAM_FT_HTTP_403 }, |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
101 { ngx_string("http_404"), NGX_HTTP_UPSTREAM_FT_HTTP_404 }, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
102 { ngx_string("updating"), NGX_HTTP_UPSTREAM_FT_UPDATING }, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
103 { ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF }, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
104 { ngx_null_string, 0 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
105 }; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
106 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
107 |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
108 #if (NGX_HTTP_SSL) |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
109 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
110 static ngx_conf_bitmask_t ngx_http_uwsgi_ssl_protocols[] = { |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
111 { ngx_string("SSLv2"), NGX_SSL_SSLv2 }, |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
112 { ngx_string("SSLv3"), NGX_SSL_SSLv3 }, |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
113 { ngx_string("TLSv1"), NGX_SSL_TLSv1 }, |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
114 { ngx_string("TLSv1.1"), NGX_SSL_TLSv1_1 }, |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
115 { ngx_string("TLSv1.2"), NGX_SSL_TLSv1_2 }, |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
116 { ngx_null_string, 0 } |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
117 }; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
118 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
119 #endif |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
120 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
121 |
3568 | 122 ngx_module_t ngx_http_uwsgi_module; |
123 | |
124 | |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
125 static ngx_command_t ngx_http_uwsgi_commands[] = { |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
126 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
127 { ngx_string("uwsgi_pass"), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
128 NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
129 ngx_http_uwsgi_pass, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
130 NGX_HTTP_LOC_CONF_OFFSET, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
131 0, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
132 NULL }, |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
133 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
134 { ngx_string("uwsgi_modifier1"), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
135 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
3552
40eba0271b1d
improve uwsgi_modifierX processing:
Igor Sysoev <igor@sysoev.ru>
parents:
3551
diff
changeset
|
136 ngx_conf_set_num_slot, |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
137 NGX_HTTP_LOC_CONF_OFFSET, |
3552
40eba0271b1d
improve uwsgi_modifierX processing:
Igor Sysoev <igor@sysoev.ru>
parents:
3551
diff
changeset
|
138 offsetof(ngx_http_uwsgi_loc_conf_t, modifier1), |
40eba0271b1d
improve uwsgi_modifierX processing:
Igor Sysoev <igor@sysoev.ru>
parents:
3551
diff
changeset
|
139 &ngx_http_uwsgi_modifier_bounds }, |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
140 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
141 { ngx_string("uwsgi_modifier2"), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
142 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
3552
40eba0271b1d
improve uwsgi_modifierX processing:
Igor Sysoev <igor@sysoev.ru>
parents:
3551
diff
changeset
|
143 ngx_conf_set_num_slot, |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
144 NGX_HTTP_LOC_CONF_OFFSET, |
3552
40eba0271b1d
improve uwsgi_modifierX processing:
Igor Sysoev <igor@sysoev.ru>
parents:
3551
diff
changeset
|
145 offsetof(ngx_http_uwsgi_loc_conf_t, modifier2), |
40eba0271b1d
improve uwsgi_modifierX processing:
Igor Sysoev <igor@sysoev.ru>
parents:
3551
diff
changeset
|
146 &ngx_http_uwsgi_modifier_bounds }, |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
147 |
3565 | 148 { ngx_string("uwsgi_store"), |
149 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, | |
150 ngx_http_uwsgi_store, | |
151 NGX_HTTP_LOC_CONF_OFFSET, | |
152 0, | |
153 NULL }, | |
154 | |
155 { ngx_string("uwsgi_store_access"), | |
156 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE123, | |
157 ngx_conf_set_access_slot, | |
158 NGX_HTTP_LOC_CONF_OFFSET, | |
159 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.store_access), | |
160 NULL }, | |
161 | |
4157
9d59a8eda373
Added uwsgi_buffering and scgi_buffering directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4015
diff
changeset
|
162 { ngx_string("uwsgi_buffering"), |
9d59a8eda373
Added uwsgi_buffering and scgi_buffering directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4015
diff
changeset
|
163 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
9d59a8eda373
Added uwsgi_buffering and scgi_buffering directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4015
diff
changeset
|
164 ngx_conf_set_flag_slot, |
9d59a8eda373
Added uwsgi_buffering and scgi_buffering directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4015
diff
changeset
|
165 NGX_HTTP_LOC_CONF_OFFSET, |
9d59a8eda373
Added uwsgi_buffering and scgi_buffering directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4015
diff
changeset
|
166 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.buffering), |
9d59a8eda373
Added uwsgi_buffering and scgi_buffering directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4015
diff
changeset
|
167 NULL }, |
9d59a8eda373
Added uwsgi_buffering and scgi_buffering directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4015
diff
changeset
|
168 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
169 { ngx_string("uwsgi_ignore_client_abort"), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
170 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
171 ngx_conf_set_flag_slot, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
172 NGX_HTTP_LOC_CONF_OFFSET, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
173 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.ignore_client_abort), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
174 NULL }, |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
175 |
3567 | 176 { ngx_string("uwsgi_bind"), |
177 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, | |
178 ngx_http_upstream_bind_set_slot, | |
179 NGX_HTTP_LOC_CONF_OFFSET, | |
180 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.local), | |
181 NULL }, | |
182 | |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
183 { ngx_string("uwsgi_connect_timeout"), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
184 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
185 ngx_conf_set_msec_slot, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
186 NGX_HTTP_LOC_CONF_OFFSET, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
187 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.connect_timeout), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
188 NULL }, |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
189 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
190 { ngx_string("uwsgi_send_timeout"), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
191 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
192 ngx_conf_set_msec_slot, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
193 NGX_HTTP_LOC_CONF_OFFSET, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
194 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.send_timeout), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
195 NULL }, |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
196 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
197 { ngx_string("uwsgi_buffer_size"), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
198 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
199 ngx_conf_set_size_slot, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
200 NGX_HTTP_LOC_CONF_OFFSET, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
201 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.buffer_size), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
202 NULL }, |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
203 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
204 { ngx_string("uwsgi_pass_request_headers"), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
205 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
206 ngx_conf_set_flag_slot, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
207 NGX_HTTP_LOC_CONF_OFFSET, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
208 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.pass_request_headers), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
209 NULL }, |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
210 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
211 { ngx_string("uwsgi_pass_request_body"), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
212 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
213 ngx_conf_set_flag_slot, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
214 NGX_HTTP_LOC_CONF_OFFSET, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
215 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.pass_request_body), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
216 NULL }, |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
217 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
218 { ngx_string("uwsgi_intercept_errors"), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
219 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
220 ngx_conf_set_flag_slot, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
221 NGX_HTTP_LOC_CONF_OFFSET, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
222 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.intercept_errors), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
223 NULL }, |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
224 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
225 { ngx_string("uwsgi_read_timeout"), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
226 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
227 ngx_conf_set_msec_slot, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
228 NGX_HTTP_LOC_CONF_OFFSET, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
229 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.read_timeout), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
230 NULL }, |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
231 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
232 { ngx_string("uwsgi_buffers"), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
233 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
234 ngx_conf_set_bufs_slot, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
235 NGX_HTTP_LOC_CONF_OFFSET, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
236 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.bufs), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
237 NULL }, |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
238 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
239 { ngx_string("uwsgi_busy_buffers_size"), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
240 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
241 ngx_conf_set_size_slot, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
242 NGX_HTTP_LOC_CONF_OFFSET, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
243 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.busy_buffers_size_conf), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
244 NULL }, |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
245 |
5874
2aff40b3dea2
Upstream: proxy_force_ranges and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5832
diff
changeset
|
246 { ngx_string("uwsgi_force_ranges"), |
2aff40b3dea2
Upstream: proxy_force_ranges and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5832
diff
changeset
|
247 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
2aff40b3dea2
Upstream: proxy_force_ranges and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5832
diff
changeset
|
248 ngx_conf_set_flag_slot, |
2aff40b3dea2
Upstream: proxy_force_ranges and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5832
diff
changeset
|
249 NGX_HTTP_LOC_CONF_OFFSET, |
2aff40b3dea2
Upstream: proxy_force_ranges and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5832
diff
changeset
|
250 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.force_ranges), |
2aff40b3dea2
Upstream: proxy_force_ranges and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5832
diff
changeset
|
251 NULL }, |
2aff40b3dea2
Upstream: proxy_force_ranges and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5832
diff
changeset
|
252 |
5883
973ee2276300
Upstream: proxy_limit_rate and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5874
diff
changeset
|
253 { ngx_string("uwsgi_limit_rate"), |
973ee2276300
Upstream: proxy_limit_rate and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5874
diff
changeset
|
254 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
973ee2276300
Upstream: proxy_limit_rate and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5874
diff
changeset
|
255 ngx_conf_set_size_slot, |
973ee2276300
Upstream: proxy_limit_rate and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5874
diff
changeset
|
256 NGX_HTTP_LOC_CONF_OFFSET, |
973ee2276300
Upstream: proxy_limit_rate and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5874
diff
changeset
|
257 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.limit_rate), |
973ee2276300
Upstream: proxy_limit_rate and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5874
diff
changeset
|
258 NULL }, |
973ee2276300
Upstream: proxy_limit_rate and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5874
diff
changeset
|
259 |
3568 | 260 #if (NGX_HTTP_CACHE) |
261 | |
262 { ngx_string("uwsgi_cache"), | |
3729 | 263 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
3568 | 264 ngx_http_uwsgi_cache, |
265 NGX_HTTP_LOC_CONF_OFFSET, | |
266 0, | |
267 NULL }, | |
268 | |
269 { ngx_string("uwsgi_cache_key"), | |
3729 | 270 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
3568 | 271 ngx_http_uwsgi_cache_key, |
272 NGX_HTTP_LOC_CONF_OFFSET, | |
273 0, | |
274 NULL }, | |
275 | |
276 { ngx_string("uwsgi_cache_path"), | |
277 NGX_HTTP_MAIN_CONF|NGX_CONF_2MORE, | |
278 ngx_http_file_cache_set_slot, | |
279 0, | |
280 0, | |
281 &ngx_http_uwsgi_module }, | |
282 | |
3699
b0a0686a85bb
proxy_cache_pass, fastcgi_cache_bypass, uwsgi_cache_bypass, scgi_cache_bypass
Igor Sysoev <igor@sysoev.ru>
parents:
3693
diff
changeset
|
283 { ngx_string("uwsgi_cache_bypass"), |
b0a0686a85bb
proxy_cache_pass, fastcgi_cache_bypass, uwsgi_cache_bypass, scgi_cache_bypass
Igor Sysoev <igor@sysoev.ru>
parents:
3693
diff
changeset
|
284 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, |
b0a0686a85bb
proxy_cache_pass, fastcgi_cache_bypass, uwsgi_cache_bypass, scgi_cache_bypass
Igor Sysoev <igor@sysoev.ru>
parents:
3693
diff
changeset
|
285 ngx_http_set_predicate_slot, |
b0a0686a85bb
proxy_cache_pass, fastcgi_cache_bypass, uwsgi_cache_bypass, scgi_cache_bypass
Igor Sysoev <igor@sysoev.ru>
parents:
3693
diff
changeset
|
286 NGX_HTTP_LOC_CONF_OFFSET, |
b0a0686a85bb
proxy_cache_pass, fastcgi_cache_bypass, uwsgi_cache_bypass, scgi_cache_bypass
Igor Sysoev <igor@sysoev.ru>
parents:
3693
diff
changeset
|
287 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.cache_bypass), |
b0a0686a85bb
proxy_cache_pass, fastcgi_cache_bypass, uwsgi_cache_bypass, scgi_cache_bypass
Igor Sysoev <igor@sysoev.ru>
parents:
3693
diff
changeset
|
288 NULL }, |
b0a0686a85bb
proxy_cache_pass, fastcgi_cache_bypass, uwsgi_cache_bypass, scgi_cache_bypass
Igor Sysoev <igor@sysoev.ru>
parents:
3693
diff
changeset
|
289 |
3568 | 290 { ngx_string("uwsgi_no_cache"), |
291 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, | |
3692
045ea40cbfe8
use ngx_http_test_predicates(), ngx_http_set_predicate_slot()
Igor Sysoev <igor@sysoev.ru>
parents:
3670
diff
changeset
|
292 ngx_http_set_predicate_slot, |
3568 | 293 NGX_HTTP_LOC_CONF_OFFSET, |
294 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.no_cache), | |
295 NULL }, | |
296 | |
297 { ngx_string("uwsgi_cache_valid"), | |
298 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, | |
299 ngx_http_file_cache_valid_set_slot, | |
300 NGX_HTTP_LOC_CONF_OFFSET, | |
301 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.cache_valid), | |
302 NULL }, | |
303 | |
304 { ngx_string("uwsgi_cache_min_uses"), | |
305 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, | |
306 ngx_conf_set_num_slot, | |
307 NGX_HTTP_LOC_CONF_OFFSET, | |
308 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.cache_min_uses), | |
309 NULL }, | |
310 | |
311 { ngx_string("uwsgi_cache_use_stale"), | |
312 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, | |
313 ngx_conf_set_bitmask_slot, | |
314 NGX_HTTP_LOC_CONF_OFFSET, | |
315 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.cache_use_stale), | |
316 &ngx_http_uwsgi_next_upstream_masks }, | |
317 | |
318 { ngx_string("uwsgi_cache_methods"), | |
319 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, | |
320 ngx_conf_set_bitmask_slot, | |
321 NGX_HTTP_LOC_CONF_OFFSET, | |
322 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.cache_methods), | |
323 &ngx_http_upstream_cache_method_mask }, | |
324 | |
4386
92deb73393f7
Cache lock support for fastcgi, scgi, uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4330
diff
changeset
|
325 { ngx_string("uwsgi_cache_lock"), |
92deb73393f7
Cache lock support for fastcgi, scgi, uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4330
diff
changeset
|
326 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
92deb73393f7
Cache lock support for fastcgi, scgi, uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4330
diff
changeset
|
327 ngx_conf_set_flag_slot, |
92deb73393f7
Cache lock support for fastcgi, scgi, uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4330
diff
changeset
|
328 NGX_HTTP_LOC_CONF_OFFSET, |
92deb73393f7
Cache lock support for fastcgi, scgi, uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4330
diff
changeset
|
329 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.cache_lock), |
92deb73393f7
Cache lock support for fastcgi, scgi, uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4330
diff
changeset
|
330 NULL }, |
92deb73393f7
Cache lock support for fastcgi, scgi, uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4330
diff
changeset
|
331 |
92deb73393f7
Cache lock support for fastcgi, scgi, uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4330
diff
changeset
|
332 { ngx_string("uwsgi_cache_lock_timeout"), |
92deb73393f7
Cache lock support for fastcgi, scgi, uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4330
diff
changeset
|
333 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
92deb73393f7
Cache lock support for fastcgi, scgi, uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4330
diff
changeset
|
334 ngx_conf_set_msec_slot, |
92deb73393f7
Cache lock support for fastcgi, scgi, uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4330
diff
changeset
|
335 NGX_HTTP_LOC_CONF_OFFSET, |
92deb73393f7
Cache lock support for fastcgi, scgi, uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4330
diff
changeset
|
336 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.cache_lock_timeout), |
92deb73393f7
Cache lock support for fastcgi, scgi, uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4330
diff
changeset
|
337 NULL }, |
92deb73393f7
Cache lock support for fastcgi, scgi, uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4330
diff
changeset
|
338 |
5905
2f7e557eab5b
Cache: proxy_cache_lock_age and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5900
diff
changeset
|
339 { ngx_string("uwsgi_cache_lock_age"), |
2f7e557eab5b
Cache: proxy_cache_lock_age and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5900
diff
changeset
|
340 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
2f7e557eab5b
Cache: proxy_cache_lock_age and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5900
diff
changeset
|
341 ngx_conf_set_msec_slot, |
2f7e557eab5b
Cache: proxy_cache_lock_age and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5900
diff
changeset
|
342 NGX_HTTP_LOC_CONF_OFFSET, |
2f7e557eab5b
Cache: proxy_cache_lock_age and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5900
diff
changeset
|
343 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.cache_lock_age), |
2f7e557eab5b
Cache: proxy_cache_lock_age and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5900
diff
changeset
|
344 NULL }, |
2f7e557eab5b
Cache: proxy_cache_lock_age and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5900
diff
changeset
|
345 |
5441
43ccaf8e8728
Upstream: cache revalidation with conditional requests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5393
diff
changeset
|
346 { ngx_string("uwsgi_cache_revalidate"), |
43ccaf8e8728
Upstream: cache revalidation with conditional requests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5393
diff
changeset
|
347 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
43ccaf8e8728
Upstream: cache revalidation with conditional requests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5393
diff
changeset
|
348 ngx_conf_set_flag_slot, |
43ccaf8e8728
Upstream: cache revalidation with conditional requests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5393
diff
changeset
|
349 NGX_HTTP_LOC_CONF_OFFSET, |
43ccaf8e8728
Upstream: cache revalidation with conditional requests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5393
diff
changeset
|
350 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.cache_revalidate), |
43ccaf8e8728
Upstream: cache revalidation with conditional requests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5393
diff
changeset
|
351 NULL }, |
43ccaf8e8728
Upstream: cache revalidation with conditional requests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5393
diff
changeset
|
352 |
3568 | 353 #endif |
354 | |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
355 { ngx_string("uwsgi_temp_path"), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
356 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1234, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
357 ngx_conf_set_path_slot, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
358 NGX_HTTP_LOC_CONF_OFFSET, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
359 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.temp_path), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
360 NULL }, |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
361 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
362 { ngx_string("uwsgi_max_temp_file_size"), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
363 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
364 ngx_conf_set_size_slot, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
365 NGX_HTTP_LOC_CONF_OFFSET, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
366 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.max_temp_file_size_conf), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
367 NULL }, |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
368 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
369 { ngx_string("uwsgi_temp_file_write_size"), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
370 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
371 ngx_conf_set_size_slot, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
372 NGX_HTTP_LOC_CONF_OFFSET, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
373 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.temp_file_write_size_conf), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
374 NULL }, |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
375 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
376 { ngx_string("uwsgi_next_upstream"), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
377 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
378 ngx_conf_set_bitmask_slot, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
379 NGX_HTTP_LOC_CONF_OFFSET, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
380 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.next_upstream), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
381 &ngx_http_uwsgi_next_upstream_masks }, |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
382 |
5832
d09b689911ac
Upstream: limited next_upstream time and tries (ticket #544).
Roman Arutyunyan <arut@nginx.com>
parents:
5829
diff
changeset
|
383 { ngx_string("uwsgi_next_upstream_tries"), |
d09b689911ac
Upstream: limited next_upstream time and tries (ticket #544).
Roman Arutyunyan <arut@nginx.com>
parents:
5829
diff
changeset
|
384 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
d09b689911ac
Upstream: limited next_upstream time and tries (ticket #544).
Roman Arutyunyan <arut@nginx.com>
parents:
5829
diff
changeset
|
385 ngx_conf_set_num_slot, |
d09b689911ac
Upstream: limited next_upstream time and tries (ticket #544).
Roman Arutyunyan <arut@nginx.com>
parents:
5829
diff
changeset
|
386 NGX_HTTP_LOC_CONF_OFFSET, |
d09b689911ac
Upstream: limited next_upstream time and tries (ticket #544).
Roman Arutyunyan <arut@nginx.com>
parents:
5829
diff
changeset
|
387 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.next_upstream_tries), |
d09b689911ac
Upstream: limited next_upstream time and tries (ticket #544).
Roman Arutyunyan <arut@nginx.com>
parents:
5829
diff
changeset
|
388 NULL }, |
d09b689911ac
Upstream: limited next_upstream time and tries (ticket #544).
Roman Arutyunyan <arut@nginx.com>
parents:
5829
diff
changeset
|
389 |
d09b689911ac
Upstream: limited next_upstream time and tries (ticket #544).
Roman Arutyunyan <arut@nginx.com>
parents:
5829
diff
changeset
|
390 { ngx_string("uwsgi_next_upstream_timeout"), |
d09b689911ac
Upstream: limited next_upstream time and tries (ticket #544).
Roman Arutyunyan <arut@nginx.com>
parents:
5829
diff
changeset
|
391 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
d09b689911ac
Upstream: limited next_upstream time and tries (ticket #544).
Roman Arutyunyan <arut@nginx.com>
parents:
5829
diff
changeset
|
392 ngx_conf_set_msec_slot, |
d09b689911ac
Upstream: limited next_upstream time and tries (ticket #544).
Roman Arutyunyan <arut@nginx.com>
parents:
5829
diff
changeset
|
393 NGX_HTTP_LOC_CONF_OFFSET, |
d09b689911ac
Upstream: limited next_upstream time and tries (ticket #544).
Roman Arutyunyan <arut@nginx.com>
parents:
5829
diff
changeset
|
394 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.next_upstream_timeout), |
d09b689911ac
Upstream: limited next_upstream time and tries (ticket #544).
Roman Arutyunyan <arut@nginx.com>
parents:
5829
diff
changeset
|
395 NULL }, |
d09b689911ac
Upstream: limited next_upstream time and tries (ticket #544).
Roman Arutyunyan <arut@nginx.com>
parents:
5829
diff
changeset
|
396 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
397 { ngx_string("uwsgi_param"), |
4330
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
398 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE23, |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
399 ngx_http_upstream_param_set_slot, |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
400 NGX_HTTP_LOC_CONF_OFFSET, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
401 offsetof(ngx_http_uwsgi_loc_conf_t, params_source), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
402 NULL }, |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
403 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
404 { ngx_string("uwsgi_string"), |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
405 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
406 ngx_conf_set_str_slot, |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
407 NGX_HTTP_LOC_CONF_OFFSET, |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
408 offsetof(ngx_http_uwsgi_loc_conf_t, uwsgi_string), |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
409 NULL }, |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
410 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
411 { ngx_string("uwsgi_pass_header"), |
3729 | 412 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
413 ngx_conf_set_str_array_slot, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
414 NGX_HTTP_LOC_CONF_OFFSET, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
415 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.pass_headers), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
416 NULL }, |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
417 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
418 { ngx_string("uwsgi_hide_header"), |
3729 | 419 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
420 ngx_conf_set_str_array_slot, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
421 NGX_HTTP_LOC_CONF_OFFSET, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
422 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.hide_headers), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
423 NULL }, |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
424 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
425 { ngx_string("uwsgi_ignore_headers"), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
426 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
427 ngx_conf_set_bitmask_slot, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
428 NGX_HTTP_LOC_CONF_OFFSET, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
429 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.ignore_headers), |
3667
12bd9e26fadb
use shared ngx_http_upstream_ignore_headers_masks[]
Igor Sysoev <igor@sysoev.ru>
parents:
3630
diff
changeset
|
430 &ngx_http_upstream_ignore_headers_masks }, |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
431 |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
432 #if (NGX_HTTP_SSL) |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
433 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
434 { ngx_string("uwsgi_ssl_session_reuse"), |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
435 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
436 ngx_conf_set_flag_slot, |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
437 NGX_HTTP_LOC_CONF_OFFSET, |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
438 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.ssl_session_reuse), |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
439 NULL }, |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
440 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
441 { ngx_string("uwsgi_ssl_protocols"), |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
442 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
443 ngx_conf_set_bitmask_slot, |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
444 NGX_HTTP_LOC_CONF_OFFSET, |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
445 offsetof(ngx_http_uwsgi_loc_conf_t, ssl_protocols), |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
446 &ngx_http_uwsgi_ssl_protocols }, |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
447 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
448 { ngx_string("uwsgi_ssl_ciphers"), |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
449 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
450 ngx_conf_set_str_slot, |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
451 NGX_HTTP_LOC_CONF_OFFSET, |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
452 offsetof(ngx_http_uwsgi_loc_conf_t, ssl_ciphers), |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
453 NULL }, |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
454 |
5662
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
455 { ngx_string("uwsgi_ssl_name"), |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
456 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
457 ngx_http_set_complex_value_slot, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
458 NGX_HTTP_LOC_CONF_OFFSET, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
459 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.ssl_name), |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
460 NULL }, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
461 |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
462 { ngx_string("uwsgi_ssl_server_name"), |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
463 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
464 ngx_conf_set_flag_slot, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
465 NGX_HTTP_LOC_CONF_OFFSET, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
466 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.ssl_server_name), |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
467 NULL }, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
468 |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
469 { ngx_string("uwsgi_ssl_verify"), |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
470 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
471 ngx_conf_set_flag_slot, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
472 NGX_HTTP_LOC_CONF_OFFSET, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
473 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.ssl_verify), |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
474 NULL }, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
475 |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
476 { ngx_string("uwsgi_ssl_verify_depth"), |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
477 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
478 ngx_conf_set_num_slot, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
479 NGX_HTTP_LOC_CONF_OFFSET, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
480 offsetof(ngx_http_uwsgi_loc_conf_t, ssl_verify_depth), |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
481 NULL }, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
482 |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
483 { ngx_string("uwsgi_ssl_trusted_certificate"), |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
484 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
485 ngx_conf_set_str_slot, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
486 NGX_HTTP_LOC_CONF_OFFSET, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
487 offsetof(ngx_http_uwsgi_loc_conf_t, ssl_trusted_certificate), |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
488 NULL }, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
489 |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
490 { ngx_string("uwsgi_ssl_crl"), |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
491 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
492 ngx_conf_set_str_slot, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
493 NGX_HTTP_LOC_CONF_OFFSET, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
494 offsetof(ngx_http_uwsgi_loc_conf_t, ssl_crl), |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
495 NULL }, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
496 |
5900
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
497 { ngx_string("uwsgi_ssl_certificate"), |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
498 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
499 ngx_conf_set_str_slot, |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
500 NGX_HTTP_LOC_CONF_OFFSET, |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
501 offsetof(ngx_http_uwsgi_loc_conf_t, ssl_certificate), |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
502 NULL }, |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
503 |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
504 { ngx_string("uwsgi_ssl_certificate_key"), |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
505 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
506 ngx_conf_set_str_slot, |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
507 NGX_HTTP_LOC_CONF_OFFSET, |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
508 offsetof(ngx_http_uwsgi_loc_conf_t, ssl_certificate_key), |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
509 NULL }, |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
510 |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
511 { ngx_string("uwsgi_ssl_password_file"), |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
512 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
513 ngx_http_uwsgi_ssl_password_file, |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
514 NGX_HTTP_LOC_CONF_OFFSET, |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
515 0, |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
516 NULL }, |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
517 |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
518 #endif |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
519 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
520 ngx_null_command |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
521 }; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
522 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
523 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
524 static ngx_http_module_t ngx_http_uwsgi_module_ctx = { |
3553
b4a60663f6c0
delete unused ngx_http_uwsgi_add_variables()
Igor Sysoev <igor@sysoev.ru>
parents:
3552
diff
changeset
|
525 NULL, /* preconfiguration */ |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
526 NULL, /* postconfiguration */ |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
527 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
528 NULL, /* create main configuration */ |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
529 NULL, /* init main configuration */ |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
530 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
531 NULL, /* create server configuration */ |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
532 NULL, /* merge server configuration */ |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
533 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
534 ngx_http_uwsgi_create_loc_conf, /* create location configuration */ |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
535 ngx_http_uwsgi_merge_loc_conf /* merge location configuration */ |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
536 }; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
537 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
538 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
539 ngx_module_t ngx_http_uwsgi_module = { |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
540 NGX_MODULE_V1, |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
541 &ngx_http_uwsgi_module_ctx, /* module context */ |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
542 ngx_http_uwsgi_commands, /* module directives */ |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
543 NGX_HTTP_MODULE, /* module type */ |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
544 NULL, /* init master */ |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
545 NULL, /* init module */ |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
546 NULL, /* init process */ |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
547 NULL, /* init thread */ |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
548 NULL, /* exit thread */ |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
549 NULL, /* exit process */ |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
550 NULL, /* exit master */ |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
551 NGX_MODULE_V1_PADDING |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
552 }; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
553 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
554 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
555 static ngx_str_t ngx_http_uwsgi_hide_headers[] = { |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
556 ngx_string("X-Accel-Expires"), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
557 ngx_string("X-Accel-Redirect"), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
558 ngx_string("X-Accel-Limit-Rate"), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
559 ngx_string("X-Accel-Buffering"), |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
560 ngx_string("X-Accel-Charset"), |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
561 ngx_null_string |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
562 }; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
563 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
564 |
3568 | 565 #if (NGX_HTTP_CACHE) |
566 | |
567 static ngx_keyval_t ngx_http_uwsgi_cache_headers[] = { | |
5441
43ccaf8e8728
Upstream: cache revalidation with conditional requests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5393
diff
changeset
|
568 { ngx_string("HTTP_IF_MODIFIED_SINCE"), |
43ccaf8e8728
Upstream: cache revalidation with conditional requests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5393
diff
changeset
|
569 ngx_string("$upstream_cache_last_modified") }, |
3568 | 570 { ngx_string("HTTP_IF_UNMODIFIED_SINCE"), ngx_string("") }, |
5738
c95d7882dfc9
Upstream: cache revalidation using If-None-Match.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5662
diff
changeset
|
571 { ngx_string("HTTP_IF_NONE_MATCH"), ngx_string("$upstream_cache_etag") }, |
3568 | 572 { ngx_string("HTTP_IF_MATCH"), ngx_string("") }, |
573 { ngx_string("HTTP_RANGE"), ngx_string("") }, | |
574 { ngx_string("HTTP_IF_RANGE"), ngx_string("") }, | |
575 { ngx_null_string, ngx_null_string } | |
576 }; | |
577 | |
578 #endif | |
579 | |
580 | |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
581 static ngx_path_init_t ngx_http_uwsgi_temp_path = { |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
582 ngx_string(NGX_HTTP_UWSGI_TEMP_PATH), { 1, 2, 0 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
583 }; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
584 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
585 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
586 static ngx_int_t |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
587 ngx_http_uwsgi_handler(ngx_http_request_t *r) |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
588 { |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
589 ngx_int_t rc; |
3629 | 590 ngx_http_status_t *status; |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
591 ngx_http_upstream_t *u; |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
592 ngx_http_uwsgi_loc_conf_t *uwcf; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
593 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
594 if (ngx_http_upstream_create(r) != NGX_OK) { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
595 return NGX_HTTP_INTERNAL_SERVER_ERROR; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
596 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
597 |
3629 | 598 status = ngx_pcalloc(r->pool, sizeof(ngx_http_status_t)); |
599 if (status == NULL) { | |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
600 return NGX_HTTP_INTERNAL_SERVER_ERROR; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
601 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
602 |
3629 | 603 ngx_http_set_ctx(r, status, ngx_http_uwsgi_module); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
604 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
605 uwcf = ngx_http_get_module_loc_conf(r, ngx_http_uwsgi_module); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
606 |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
607 u = r->upstream; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
608 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
609 if (uwcf->uwsgi_lengths == NULL) { |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
610 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
611 #if (NGX_HTTP_SSL) |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
612 u->ssl = (uwcf->upstream.ssl != NULL); |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
613 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
614 if (u->ssl) { |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
615 ngx_str_set(&u->schema, "suwsgi://"); |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
616 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
617 } else { |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
618 ngx_str_set(&u->schema, "uwsgi://"); |
5467
f6258a7092e4
Trailing whitespace fix.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5462
diff
changeset
|
619 } |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
620 #else |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
621 ngx_str_set(&u->schema, "uwsgi://"); |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
622 #endif |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
623 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
624 } else { |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
625 if (ngx_http_uwsgi_eval(r, uwcf) != NGX_OK) { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
626 return NGX_HTTP_INTERNAL_SERVER_ERROR; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
627 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
628 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
629 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
630 u->output.tag = (ngx_buf_tag_t) &ngx_http_uwsgi_module; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
631 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
632 u->conf = &uwcf->upstream; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
633 |
3568 | 634 #if (NGX_HTTP_CACHE) |
635 u->create_key = ngx_http_uwsgi_create_key; | |
636 #endif | |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
637 u->create_request = ngx_http_uwsgi_create_request; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
638 u->reinit_request = ngx_http_uwsgi_reinit_request; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
639 u->process_header = ngx_http_uwsgi_process_status_line; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
640 u->abort_request = ngx_http_uwsgi_abort_request; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
641 u->finalize_request = ngx_http_uwsgi_finalize_request; |
4615
adcd60233817
Added r->state reset on fastcgi/scgi/uwsgi request start.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4593
diff
changeset
|
642 r->state = 0; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
643 |
4157
9d59a8eda373
Added uwsgi_buffering and scgi_buffering directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4015
diff
changeset
|
644 u->buffering = uwcf->upstream.buffering; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
645 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
646 u->pipe = ngx_pcalloc(r->pool, sizeof(ngx_event_pipe_t)); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
647 if (u->pipe == NULL) { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
648 return NGX_HTTP_INTERNAL_SERVER_ERROR; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
649 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
650 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
651 u->pipe->input_filter = ngx_event_pipe_copy_input_filter; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
652 u->pipe->input_ctx = r; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
653 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
654 rc = ngx_http_read_client_request_body(r, ngx_http_upstream_init); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
655 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
656 if (rc >= NGX_HTTP_SPECIAL_RESPONSE) { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
657 return rc; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
658 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
659 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
660 return NGX_DONE; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
661 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
662 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
663 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
664 static ngx_int_t |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
665 ngx_http_uwsgi_eval(ngx_http_request_t *r, ngx_http_uwsgi_loc_conf_t * uwcf) |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
666 { |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
667 size_t add; |
3610 | 668 ngx_url_t url; |
669 ngx_http_upstream_t *u; | |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
670 |
3610 | 671 ngx_memzero(&url, sizeof(ngx_url_t)); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
672 |
3610 | 673 if (ngx_http_script_run(r, &url.url, uwcf->uwsgi_lengths->elts, 0, |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
674 uwcf->uwsgi_values->elts) |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
675 == NULL) |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
676 { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
677 return NGX_ERROR; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
678 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
679 |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
680 if (url.url.len > 8 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
681 && ngx_strncasecmp(url.url.data, (u_char *) "uwsgi://", 8) == 0) |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
682 { |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
683 add = 8; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
684 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
685 } else if (url.url.len > 9 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
686 && ngx_strncasecmp(url.url.data, (u_char *) "suwsgi://", 9) == 0) |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
687 { |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
688 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
689 #if (NGX_HTTP_SSL) |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
690 add = 9; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
691 r->upstream->ssl = 1; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
692 #else |
5458
4a71ef1aa36d
Fixed build without SSL, broken by c82b2e020b9f.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5457
diff
changeset
|
693 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, |
4a71ef1aa36d
Fixed build without SSL, broken by c82b2e020b9f.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5457
diff
changeset
|
694 "suwsgi protocol requires SSL support"); |
4a71ef1aa36d
Fixed build without SSL, broken by c82b2e020b9f.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5457
diff
changeset
|
695 return NGX_ERROR; |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
696 #endif |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
697 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
698 } else { |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
699 add = 0; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
700 } |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
701 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
702 u = r->upstream; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
703 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
704 if (add) { |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
705 u->schema.len = add; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
706 u->schema.data = url.url.data; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
707 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
708 url.url.data += add; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
709 url.url.len -= add; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
710 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
711 } else { |
5462
58716fd3bd2d
Fixed incorrect ngx_str_set() usage, broken in c82b2e020b9f.
Piotr Sikora <piotr@cloudflare.com>
parents:
5458
diff
changeset
|
712 ngx_str_set(&u->schema, "uwsgi://"); |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
713 } |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
714 |
3610 | 715 url.no_resolve = 1; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
716 |
3610 | 717 if (ngx_parse_url(r->pool, &url) != NGX_OK) { |
718 if (url.err) { | |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
719 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, |
3610 | 720 "%s in upstream \"%V\"", url.err, &url.url); |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
721 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
722 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
723 return NGX_ERROR; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
724 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
725 |
3610 | 726 u->resolved = ngx_pcalloc(r->pool, sizeof(ngx_http_upstream_resolved_t)); |
727 if (u->resolved == NULL) { | |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
728 return NGX_ERROR; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
729 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
730 |
3610 | 731 if (url.addrs && url.addrs[0].sockaddr) { |
732 u->resolved->sockaddr = url.addrs[0].sockaddr; | |
733 u->resolved->socklen = url.addrs[0].socklen; | |
734 u->resolved->naddrs = 1; | |
735 u->resolved->host = url.addrs[0].name; | |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
736 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
737 } else { |
3610 | 738 u->resolved->host = url.host; |
739 u->resolved->port = url.port; | |
3879
502a6b0acf3f
fix case when a host in fastcgi_pass, scgi_pass, and uwsgi_pass
Igor Sysoev <igor@sysoev.ru>
parents:
3731
diff
changeset
|
740 u->resolved->no_port = url.no_port; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
741 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
742 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
743 return NGX_OK; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
744 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
745 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
746 |
3568 | 747 #if (NGX_HTTP_CACHE) |
748 | |
749 static ngx_int_t | |
750 ngx_http_uwsgi_create_key(ngx_http_request_t *r) | |
751 { | |
752 ngx_str_t *key; | |
753 ngx_http_uwsgi_loc_conf_t *uwcf; | |
754 | |
755 key = ngx_array_push(&r->cache->keys); | |
756 if (key == NULL) { | |
757 return NGX_ERROR; | |
758 } | |
759 | |
760 uwcf = ngx_http_get_module_loc_conf(r, ngx_http_uwsgi_module); | |
761 | |
762 if (ngx_http_complex_value(r, &uwcf->cache_key, key) != NGX_OK) { | |
763 return NGX_ERROR; | |
764 } | |
765 | |
766 return NGX_OK; | |
767 } | |
768 | |
769 #endif | |
770 | |
771 | |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
772 static ngx_int_t |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
773 ngx_http_uwsgi_create_request(ngx_http_request_t *r) |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
774 { |
3566
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
775 u_char ch, *lowcase_key; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
776 size_t key_len, val_len, len, allocated; |
4330
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
777 ngx_uint_t i, n, hash, skip_empty, header_params; |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
778 ngx_buf_t *b; |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
779 ngx_chain_t *cl, *body; |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
780 ngx_list_part_t *part; |
3566
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
781 ngx_table_elt_t *header, **ignored; |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
782 ngx_http_script_code_pt code; |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
783 ngx_http_script_engine_t e, le; |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
784 ngx_http_uwsgi_loc_conf_t *uwcf; |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
785 ngx_http_script_len_code_pt lcode; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
786 |
3546
3a9fca8cbdfc
simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents:
3545
diff
changeset
|
787 len = 0; |
3566
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
788 header_params = 0; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
789 ignored = NULL; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
790 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
791 uwcf = ngx_http_get_module_loc_conf(r, ngx_http_uwsgi_module); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
792 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
793 if (uwcf->params_len) { |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
794 ngx_memzero(&le, sizeof(ngx_http_script_engine_t)); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
795 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
796 ngx_http_script_flush_no_cacheable_variables(r, uwcf->flushes); |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
797 le.flushed = 1; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
798 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
799 le.ip = uwcf->params_len->elts; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
800 le.request = r; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
801 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
802 while (*(uintptr_t *) le.ip) { |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
803 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
804 lcode = *(ngx_http_script_len_code_pt *) le.ip; |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
805 key_len = lcode(&le); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
806 |
4330
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
807 lcode = *(ngx_http_script_len_code_pt *) le.ip; |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
808 skip_empty = lcode(&le); |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
809 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
810 for (val_len = 0; *(uintptr_t *) le.ip; val_len += lcode (&le)) { |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
811 lcode = *(ngx_http_script_len_code_pt *) le.ip; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
812 } |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
813 le.ip += sizeof(uintptr_t); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
814 |
4330
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
815 if (skip_empty && val_len == 0) { |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
816 continue; |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
817 } |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
818 |
3546
3a9fca8cbdfc
simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents:
3545
diff
changeset
|
819 len += 2 + key_len + 2 + val_len; |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
820 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
821 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
822 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
823 if (uwcf->upstream.pass_request_headers) { |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
824 |
3566
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
825 allocated = 0; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
826 lowcase_key = NULL; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
827 |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
828 if (uwcf->header_params) { |
4015
e0a435f5f504
Fix ignored headers handling in fastcgi/scgi/uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3976
diff
changeset
|
829 n = 0; |
e0a435f5f504
Fix ignored headers handling in fastcgi/scgi/uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3976
diff
changeset
|
830 part = &r->headers_in.headers.part; |
e0a435f5f504
Fix ignored headers handling in fastcgi/scgi/uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3976
diff
changeset
|
831 |
e0a435f5f504
Fix ignored headers handling in fastcgi/scgi/uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3976
diff
changeset
|
832 while (part) { |
e0a435f5f504
Fix ignored headers handling in fastcgi/scgi/uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3976
diff
changeset
|
833 n += part->nelts; |
e0a435f5f504
Fix ignored headers handling in fastcgi/scgi/uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3976
diff
changeset
|
834 part = part->next; |
e0a435f5f504
Fix ignored headers handling in fastcgi/scgi/uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3976
diff
changeset
|
835 } |
e0a435f5f504
Fix ignored headers handling in fastcgi/scgi/uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3976
diff
changeset
|
836 |
e0a435f5f504
Fix ignored headers handling in fastcgi/scgi/uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3976
diff
changeset
|
837 ignored = ngx_palloc(r->pool, n * sizeof(void *)); |
3566
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
838 if (ignored == NULL) { |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
839 return NGX_ERROR; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
840 } |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
841 } |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
842 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
843 part = &r->headers_in.headers.part; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
844 header = part->elts; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
845 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
846 for (i = 0; /* void */ ; i++) { |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
847 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
848 if (i >= part->nelts) { |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
849 if (part->next == NULL) { |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
850 break; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
851 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
852 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
853 part = part->next; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
854 header = part->elts; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
855 i = 0; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
856 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
857 |
3566
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
858 if (uwcf->header_params) { |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
859 if (allocated < header[i].key.len) { |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
860 allocated = header[i].key.len + 16; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
861 lowcase_key = ngx_pnalloc(r->pool, allocated); |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
862 if (lowcase_key == NULL) { |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
863 return NGX_ERROR; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
864 } |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
865 } |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
866 |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
867 hash = 0; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
868 |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
869 for (n = 0; n < header[i].key.len; n++) { |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
870 ch = header[i].key.data[n]; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
871 |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
872 if (ch >= 'A' && ch <= 'Z') { |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
873 ch |= 0x20; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
874 |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
875 } else if (ch == '-') { |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
876 ch = '_'; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
877 } |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
878 |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
879 hash = ngx_hash(hash, ch); |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
880 lowcase_key[n] = ch; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
881 } |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
882 |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
883 if (ngx_hash_find(&uwcf->headers_hash, hash, lowcase_key, n)) { |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
884 ignored[header_params++] = &header[i]; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
885 continue; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
886 } |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
887 } |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
888 |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
889 len += 2 + sizeof("HTTP_") - 1 + header[i].key.len |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
890 + 2 + header[i].value.len; |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
891 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
892 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
893 |
3555
bc734cf061b0
improve uwsgi_string processing
Igor Sysoev <igor@sysoev.ru>
parents:
3554
diff
changeset
|
894 len += uwcf->uwsgi_string.len; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
895 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
896 #if 0 |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
897 /* allow custom uwsgi packet */ |
3546
3a9fca8cbdfc
simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents:
3545
diff
changeset
|
898 if (len > 0 && len < 2) { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
899 ngx_log_error (NGX_LOG_ALERT, r->connection->log, 0, |
3546
3a9fca8cbdfc
simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents:
3545
diff
changeset
|
900 "uwsgi request is too little: %uz", len); |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
901 return NGX_ERROR; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
902 } |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
903 #endif |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
904 |
3546
3a9fca8cbdfc
simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents:
3545
diff
changeset
|
905 b = ngx_create_temp_buf(r->pool, len + 4); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
906 if (b == NULL) { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
907 return NGX_ERROR; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
908 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
909 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
910 cl = ngx_alloc_chain_link(r->pool); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
911 if (cl == NULL) { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
912 return NGX_ERROR; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
913 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
914 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
915 cl->buf = b; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
916 |
3552
40eba0271b1d
improve uwsgi_modifierX processing:
Igor Sysoev <igor@sysoev.ru>
parents:
3551
diff
changeset
|
917 *b->last++ = (u_char) uwcf->modifier1; |
3546
3a9fca8cbdfc
simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents:
3545
diff
changeset
|
918 *b->last++ = (u_char) (len & 0xff); |
3a9fca8cbdfc
simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents:
3545
diff
changeset
|
919 *b->last++ = (u_char) ((len >> 8) & 0xff); |
3552
40eba0271b1d
improve uwsgi_modifierX processing:
Igor Sysoev <igor@sysoev.ru>
parents:
3551
diff
changeset
|
920 *b->last++ = (u_char) uwcf->modifier2; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
921 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
922 if (uwcf->params_len) { |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
923 ngx_memzero(&e, sizeof(ngx_http_script_engine_t)); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
924 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
925 e.ip = uwcf->params->elts; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
926 e.pos = b->last; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
927 e.request = r; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
928 e.flushed = 1; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
929 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
930 le.ip = uwcf->params_len->elts; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
931 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
932 while (*(uintptr_t *) le.ip) { |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
933 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
934 lcode = *(ngx_http_script_len_code_pt *) le.ip; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
935 key_len = (u_char) lcode (&le); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
936 |
4330
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
937 lcode = *(ngx_http_script_len_code_pt *) le.ip; |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
938 skip_empty = lcode(&le); |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
939 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
940 for (val_len = 0; *(uintptr_t *) le.ip; val_len += lcode(&le)) { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
941 lcode = *(ngx_http_script_len_code_pt *) le.ip; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
942 } |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
943 le.ip += sizeof(uintptr_t); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
944 |
4330
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
945 if (skip_empty && val_len == 0) { |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
946 e.skip = 1; |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
947 |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
948 while (*(uintptr_t *) e.ip) { |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
949 code = *(ngx_http_script_code_pt *) e.ip; |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
950 code((ngx_http_script_engine_t *) &e); |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
951 } |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
952 e.ip += sizeof(uintptr_t); |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
953 |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
954 e.skip = 0; |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
955 |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
956 continue; |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
957 } |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
958 |
3546
3a9fca8cbdfc
simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents:
3545
diff
changeset
|
959 *e.pos++ = (u_char) (key_len & 0xff); |
3a9fca8cbdfc
simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents:
3545
diff
changeset
|
960 *e.pos++ = (u_char) ((key_len >> 8) & 0xff); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
961 |
3547
c2da61796410
remove useless copy: key name should be just copied before value length
Igor Sysoev <igor@sysoev.ru>
parents:
3546
diff
changeset
|
962 code = *(ngx_http_script_code_pt *) e.ip; |
c2da61796410
remove useless copy: key name should be just copied before value length
Igor Sysoev <igor@sysoev.ru>
parents:
3546
diff
changeset
|
963 code((ngx_http_script_engine_t *) & e); |
c2da61796410
remove useless copy: key name should be just copied before value length
Igor Sysoev <igor@sysoev.ru>
parents:
3546
diff
changeset
|
964 |
c2da61796410
remove useless copy: key name should be just copied before value length
Igor Sysoev <igor@sysoev.ru>
parents:
3546
diff
changeset
|
965 *e.pos++ = (u_char) (val_len & 0xff); |
c2da61796410
remove useless copy: key name should be just copied before value length
Igor Sysoev <igor@sysoev.ru>
parents:
3546
diff
changeset
|
966 *e.pos++ = (u_char) ((val_len >> 8) & 0xff); |
c2da61796410
remove useless copy: key name should be just copied before value length
Igor Sysoev <igor@sysoev.ru>
parents:
3546
diff
changeset
|
967 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
968 while (*(uintptr_t *) e.ip) { |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
969 code = *(ngx_http_script_code_pt *) e.ip; |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
970 code((ngx_http_script_engine_t *) & e); |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
971 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
972 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
973 e.ip += sizeof(uintptr_t); |
3564
3da009cc90f3
add uwsgi_param and client request headers debug logging
Igor Sysoev <igor@sysoev.ru>
parents:
3556
diff
changeset
|
974 |
3da009cc90f3
add uwsgi_param and client request headers debug logging
Igor Sysoev <igor@sysoev.ru>
parents:
3556
diff
changeset
|
975 ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
3da009cc90f3
add uwsgi_param and client request headers debug logging
Igor Sysoev <igor@sysoev.ru>
parents:
3556
diff
changeset
|
976 "uwsgi param: \"%*s: %*s\"", |
3da009cc90f3
add uwsgi_param and client request headers debug logging
Igor Sysoev <igor@sysoev.ru>
parents:
3556
diff
changeset
|
977 key_len, e.pos - (key_len + 2 + val_len), |
3da009cc90f3
add uwsgi_param and client request headers debug logging
Igor Sysoev <igor@sysoev.ru>
parents:
3556
diff
changeset
|
978 val_len, e.pos - val_len); |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
979 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
980 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
981 b->last = e.pos; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
982 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
983 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
984 if (uwcf->upstream.pass_request_headers) { |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
985 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
986 part = &r->headers_in.headers.part; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
987 header = part->elts; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
988 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
989 for (i = 0; /* void */ ; i++) { |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
990 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
991 if (i >= part->nelts) { |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
992 if (part->next == NULL) { |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
993 break; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
994 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
995 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
996 part = part->next; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
997 header = part->elts; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
998 i = 0; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
999 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1000 |
3566
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1001 for (n = 0; n < header_params; n++) { |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1002 if (&header[i] == ignored[n]) { |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1003 goto next; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1004 } |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1005 } |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1006 |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1007 key_len = sizeof("HTTP_") - 1 + header[i].key.len; |
3546
3a9fca8cbdfc
simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents:
3545
diff
changeset
|
1008 *b->last++ = (u_char) (key_len & 0xff); |
3a9fca8cbdfc
simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents:
3545
diff
changeset
|
1009 *b->last++ = (u_char) ((key_len >> 8) & 0xff); |
3a9fca8cbdfc
simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents:
3545
diff
changeset
|
1010 |
3566
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1011 b->last = ngx_cpymem(b->last, "HTTP_", sizeof("HTTP_") - 1); |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1012 for (n = 0; n < header[i].key.len; n++) { |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1013 ch = header[i].key.data[n]; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1014 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1015 if (ch >= 'a' && ch <= 'z') { |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1016 ch &= ~0x20; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1017 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1018 } else if (ch == '-') { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1019 ch = '_'; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1020 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1021 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1022 *b->last++ = ch; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1023 } |
3546
3a9fca8cbdfc
simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents:
3545
diff
changeset
|
1024 |
3a9fca8cbdfc
simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents:
3545
diff
changeset
|
1025 val_len = header[i].value.len; |
3a9fca8cbdfc
simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents:
3545
diff
changeset
|
1026 *b->last++ = (u_char) (val_len & 0xff); |
3a9fca8cbdfc
simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents:
3545
diff
changeset
|
1027 *b->last++ = (u_char) ((val_len >> 8) & 0xff); |
3a9fca8cbdfc
simplify binary little endian length processing
Igor Sysoev <igor@sysoev.ru>
parents:
3545
diff
changeset
|
1028 b->last = ngx_copy(b->last, header[i].value.data, val_len); |
3564
3da009cc90f3
add uwsgi_param and client request headers debug logging
Igor Sysoev <igor@sysoev.ru>
parents:
3556
diff
changeset
|
1029 |
3da009cc90f3
add uwsgi_param and client request headers debug logging
Igor Sysoev <igor@sysoev.ru>
parents:
3556
diff
changeset
|
1030 ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
3da009cc90f3
add uwsgi_param and client request headers debug logging
Igor Sysoev <igor@sysoev.ru>
parents:
3556
diff
changeset
|
1031 "uwsgi param: \"%*s: %*s\"", |
3da009cc90f3
add uwsgi_param and client request headers debug logging
Igor Sysoev <igor@sysoev.ru>
parents:
3556
diff
changeset
|
1032 key_len, b->last - (key_len + 2 + val_len), |
3da009cc90f3
add uwsgi_param and client request headers debug logging
Igor Sysoev <igor@sysoev.ru>
parents:
3556
diff
changeset
|
1033 val_len, b->last - val_len); |
3566
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1034 next: |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1035 |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1036 continue; |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1037 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1038 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1039 |
3555
bc734cf061b0
improve uwsgi_string processing
Igor Sysoev <igor@sysoev.ru>
parents:
3554
diff
changeset
|
1040 b->last = ngx_copy(b->last, uwcf->uwsgi_string.data, |
bc734cf061b0
improve uwsgi_string processing
Igor Sysoev <igor@sysoev.ru>
parents:
3554
diff
changeset
|
1041 uwcf->uwsgi_string.len); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1042 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1043 if (uwcf->upstream.pass_request_body) { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1044 body = r->upstream->request_bufs; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1045 r->upstream->request_bufs = cl; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1046 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1047 while (body) { |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1048 b = ngx_alloc_buf(r->pool); |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1049 if (b == NULL) { |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1050 return NGX_ERROR; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1051 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1052 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1053 ngx_memcpy(b, body->buf, sizeof(ngx_buf_t)); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1054 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1055 cl->next = ngx_alloc_chain_link(r->pool); |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1056 if (cl->next == NULL) { |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1057 return NGX_ERROR; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1058 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1059 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1060 cl = cl->next; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1061 cl->buf = b; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1062 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1063 body = body->next; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1064 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1065 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1066 } else { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1067 r->upstream->request_bufs = cl; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1068 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1069 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1070 cl->next = NULL; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1071 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1072 return NGX_OK; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1073 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1074 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1075 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1076 static ngx_int_t |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1077 ngx_http_uwsgi_reinit_request(ngx_http_request_t *r) |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1078 { |
3629 | 1079 ngx_http_status_t *status; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1080 |
3629 | 1081 status = ngx_http_get_module_ctx(r, ngx_http_uwsgi_module); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1082 |
3629 | 1083 if (status == NULL) { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1084 return NGX_OK; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1085 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1086 |
3629 | 1087 status->code = 0; |
1088 status->count = 0; | |
1089 status->start = NULL; | |
1090 status->end = NULL; | |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1091 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1092 r->upstream->process_header = ngx_http_uwsgi_process_status_line; |
4615
adcd60233817
Added r->state reset on fastcgi/scgi/uwsgi request start.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4593
diff
changeset
|
1093 r->state = 0; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1094 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1095 return NGX_OK; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1096 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1097 |
3623 | 1098 |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1099 static ngx_int_t |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1100 ngx_http_uwsgi_process_status_line(ngx_http_request_t *r) |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1101 { |
3628 | 1102 size_t len; |
3623 | 1103 ngx_int_t rc; |
3630 | 1104 ngx_http_status_t *status; |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1105 ngx_http_upstream_t *u; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1106 |
3627
9061fdb2ed8c
use ngx_http_parse_status_line()
Igor Sysoev <igor@sysoev.ru>
parents:
3625
diff
changeset
|
1107 status = ngx_http_get_module_ctx(r, ngx_http_uwsgi_module); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1108 |
3627
9061fdb2ed8c
use ngx_http_parse_status_line()
Igor Sysoev <igor@sysoev.ru>
parents:
3625
diff
changeset
|
1109 if (status == NULL) { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1110 return NGX_ERROR; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1111 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1112 |
3627
9061fdb2ed8c
use ngx_http_parse_status_line()
Igor Sysoev <igor@sysoev.ru>
parents:
3625
diff
changeset
|
1113 u = r->upstream; |
9061fdb2ed8c
use ngx_http_parse_status_line()
Igor Sysoev <igor@sysoev.ru>
parents:
3625
diff
changeset
|
1114 |
9061fdb2ed8c
use ngx_http_parse_status_line()
Igor Sysoev <igor@sysoev.ru>
parents:
3625
diff
changeset
|
1115 rc = ngx_http_parse_status_line(r, &u->buffer, status); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1116 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1117 if (rc == NGX_AGAIN) { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1118 return rc; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1119 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1120 |
3627
9061fdb2ed8c
use ngx_http_parse_status_line()
Igor Sysoev <igor@sysoev.ru>
parents:
3625
diff
changeset
|
1121 if (rc == NGX_ERROR) { |
3624 | 1122 u->process_header = ngx_http_uwsgi_process_header; |
1123 return ngx_http_uwsgi_process_header(r); | |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1124 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1125 |
5575
d15822784cf9
Upstream: fix $upstream_status variable.
Piotr Sikora <piotr@cloudflare.com>
parents:
5496
diff
changeset
|
1126 if (u->state && u->state->status == 0) { |
3627
9061fdb2ed8c
use ngx_http_parse_status_line()
Igor Sysoev <igor@sysoev.ru>
parents:
3625
diff
changeset
|
1127 u->state->status = status->code; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1128 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1129 |
3627
9061fdb2ed8c
use ngx_http_parse_status_line()
Igor Sysoev <igor@sysoev.ru>
parents:
3625
diff
changeset
|
1130 u->headers_in.status_n = status->code; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1131 |
3628 | 1132 len = status->end - status->start; |
1133 u->headers_in.status_line.len = len; | |
1134 | |
1135 u->headers_in.status_line.data = ngx_pnalloc(r->pool, len); | |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1136 if (u->headers_in.status_line.data == NULL) { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1137 return NGX_ERROR; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1138 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1139 |
3628 | 1140 ngx_memcpy(u->headers_in.status_line.data, status->start, len); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1141 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1142 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1143 "http uwsgi status %ui \"%V\"", |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1144 u->headers_in.status_n, &u->headers_in.status_line); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1145 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1146 u->process_header = ngx_http_uwsgi_process_header; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1147 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1148 return ngx_http_uwsgi_process_header(r); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1149 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1150 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1151 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1152 static ngx_int_t |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1153 ngx_http_uwsgi_process_header(ngx_http_request_t *r) |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1154 { |
3624 | 1155 ngx_str_t *status_line; |
1156 ngx_int_t rc, status; | |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1157 ngx_table_elt_t *h; |
3624 | 1158 ngx_http_upstream_t *u; |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1159 ngx_http_upstream_header_t *hh; |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1160 ngx_http_upstream_main_conf_t *umcf; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1161 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1162 umcf = ngx_http_get_module_main_conf(r, ngx_http_upstream_module); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1163 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1164 for ( ;; ) { |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1165 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1166 rc = ngx_http_parse_header_line(r, &r->upstream->buffer, 1); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1167 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1168 if (rc == NGX_OK) { |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1169 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1170 /* a header line has been parsed successfully */ |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1171 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1172 h = ngx_list_push(&r->upstream->headers_in.headers); |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1173 if (h == NULL) { |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1174 return NGX_ERROR; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1175 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1176 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1177 h->hash = r->header_hash; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1178 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1179 h->key.len = r->header_name_end - r->header_name_start; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1180 h->value.len = r->header_end - r->header_start; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1181 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1182 h->key.data = ngx_pnalloc(r->pool, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1183 h->key.len + 1 + h->value.len + 1 |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1184 + h->key.len); |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1185 if (h->key.data == NULL) { |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1186 return NGX_ERROR; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1187 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1188 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1189 h->value.data = h->key.data + h->key.len + 1; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1190 h->lowcase_key = h->key.data + h->key.len + 1 + h->value.len + 1; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1191 |
4529
1ebec1d15a25
Fixed incorrect ngx_cpystrn() usage in ngx_http_*_process_header().
Maxim Dounin <mdounin@mdounin.ru>
parents:
4527
diff
changeset
|
1192 ngx_memcpy(h->key.data, r->header_name_start, h->key.len); |
1ebec1d15a25
Fixed incorrect ngx_cpystrn() usage in ngx_http_*_process_header().
Maxim Dounin <mdounin@mdounin.ru>
parents:
4527
diff
changeset
|
1193 h->key.data[h->key.len] = '\0'; |
1ebec1d15a25
Fixed incorrect ngx_cpystrn() usage in ngx_http_*_process_header().
Maxim Dounin <mdounin@mdounin.ru>
parents:
4527
diff
changeset
|
1194 ngx_memcpy(h->value.data, r->header_start, h->value.len); |
1ebec1d15a25
Fixed incorrect ngx_cpystrn() usage in ngx_http_*_process_header().
Maxim Dounin <mdounin@mdounin.ru>
parents:
4527
diff
changeset
|
1195 h->value.data[h->value.len] = '\0'; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1196 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1197 if (h->key.len == r->lowcase_index) { |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1198 ngx_memcpy(h->lowcase_key, r->lowcase_header, h->key.len); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1199 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1200 } else { |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1201 ngx_strlow(h->lowcase_key, h->key.data, h->key.len); |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1202 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1203 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1204 hh = ngx_hash_find(&umcf->headers_in_hash, h->hash, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1205 h->lowcase_key, h->key.len); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1206 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1207 if (hh && hh->handler(r, h, hh->offset) != NGX_OK) { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1208 return NGX_ERROR; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1209 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1210 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1211 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1212 "http uwsgi header: \"%V: %V\"", &h->key, &h->value); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1213 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1214 continue; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1215 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1216 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1217 if (rc == NGX_HTTP_PARSE_HEADER_DONE) { |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1218 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1219 /* a whole header has been parsed successfully */ |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1220 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1221 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1222 "http uwsgi header done"); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1223 |
4527
9c3a2fc3c460
Uwsgi: merged r->http_version fixes from scgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4522
diff
changeset
|
1224 u = r->upstream; |
9c3a2fc3c460
Uwsgi: merged r->http_version fixes from scgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4522
diff
changeset
|
1225 |
9c3a2fc3c460
Uwsgi: merged r->http_version fixes from scgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4522
diff
changeset
|
1226 if (u->headers_in.status_n) { |
5078
10c74d3b15d1
Connection upgrade support in uwsgi and scgi modules.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5008
diff
changeset
|
1227 goto done; |
3624 | 1228 } |
1229 | |
1230 if (u->headers_in.status) { | |
1231 status_line = &u->headers_in.status->value; | |
1232 | |
1233 status = ngx_atoi(status_line->data, 3); | |
1234 if (status == NGX_ERROR) { | |
1235 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, | |
1236 "upstream sent invalid status \"%V\"", | |
1237 status_line); | |
1238 return NGX_HTTP_UPSTREAM_INVALID_HEADER; | |
1239 } | |
1240 | |
1241 u->headers_in.status_n = status; | |
1242 u->headers_in.status_line = *status_line; | |
1243 | |
1244 } else if (u->headers_in.location) { | |
1245 u->headers_in.status_n = 302; | |
1246 ngx_str_set(&u->headers_in.status_line, | |
1247 "302 Moved Temporarily"); | |
1248 | |
1249 } else { | |
1250 u->headers_in.status_n = 200; | |
1251 ngx_str_set(&u->headers_in.status_line, "200 OK"); | |
1252 } | |
1253 | |
5575
d15822784cf9
Upstream: fix $upstream_status variable.
Piotr Sikora <piotr@cloudflare.com>
parents:
5496
diff
changeset
|
1254 if (u->state && u->state->status == 0) { |
3624 | 1255 u->state->status = u->headers_in.status_n; |
1256 } | |
1257 | |
5078
10c74d3b15d1
Connection upgrade support in uwsgi and scgi modules.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5008
diff
changeset
|
1258 done: |
10c74d3b15d1
Connection upgrade support in uwsgi and scgi modules.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5008
diff
changeset
|
1259 |
10c74d3b15d1
Connection upgrade support in uwsgi and scgi modules.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5008
diff
changeset
|
1260 if (u->headers_in.status_n == NGX_HTTP_SWITCHING_PROTOCOLS |
5080
8da37c1b22a4
Trailing whitespace fix.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5078
diff
changeset
|
1261 && r->headers_in.upgrade) |
5078
10c74d3b15d1
Connection upgrade support in uwsgi and scgi modules.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5008
diff
changeset
|
1262 { |
10c74d3b15d1
Connection upgrade support in uwsgi and scgi modules.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5008
diff
changeset
|
1263 u->upgrade = 1; |
10c74d3b15d1
Connection upgrade support in uwsgi and scgi modules.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5008
diff
changeset
|
1264 } |
10c74d3b15d1
Connection upgrade support in uwsgi and scgi modules.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5008
diff
changeset
|
1265 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1266 return NGX_OK; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1267 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1268 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1269 if (rc == NGX_AGAIN) { |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1270 return NGX_AGAIN; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1271 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1272 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1273 /* there was error while a header line parsing */ |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1274 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1275 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1276 "upstream sent invalid header"); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1277 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1278 return NGX_HTTP_UPSTREAM_INVALID_HEADER; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1279 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1280 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1281 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1282 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1283 static void |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1284 ngx_http_uwsgi_abort_request(ngx_http_request_t *r) |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1285 { |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1286 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1287 "abort http uwsgi request"); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1288 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1289 return; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1290 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1291 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1292 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1293 static void |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1294 ngx_http_uwsgi_finalize_request(ngx_http_request_t *r, ngx_int_t rc) |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1295 { |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1296 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1297 "finalize http uwsgi request"); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1298 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1299 return; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1300 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1301 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1302 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1303 static void * |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1304 ngx_http_uwsgi_create_loc_conf(ngx_conf_t *cf) |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1305 { |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1306 ngx_http_uwsgi_loc_conf_t *conf; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1307 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1308 conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_uwsgi_loc_conf_t)); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1309 if (conf == NULL) { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1310 return NULL; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1311 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1312 |
3552
40eba0271b1d
improve uwsgi_modifierX processing:
Igor Sysoev <igor@sysoev.ru>
parents:
3551
diff
changeset
|
1313 conf->modifier1 = NGX_CONF_UNSET_UINT; |
40eba0271b1d
improve uwsgi_modifierX processing:
Igor Sysoev <igor@sysoev.ru>
parents:
3551
diff
changeset
|
1314 conf->modifier2 = NGX_CONF_UNSET_UINT; |
40eba0271b1d
improve uwsgi_modifierX processing:
Igor Sysoev <igor@sysoev.ru>
parents:
3551
diff
changeset
|
1315 |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1316 conf->upstream.store = NGX_CONF_UNSET; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1317 conf->upstream.store_access = NGX_CONF_UNSET_UINT; |
5832
d09b689911ac
Upstream: limited next_upstream time and tries (ticket #544).
Roman Arutyunyan <arut@nginx.com>
parents:
5829
diff
changeset
|
1318 conf->upstream.next_upstream_tries = NGX_CONF_UNSET_UINT; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1319 conf->upstream.buffering = NGX_CONF_UNSET; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1320 conf->upstream.ignore_client_abort = NGX_CONF_UNSET; |
5874
2aff40b3dea2
Upstream: proxy_force_ranges and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5832
diff
changeset
|
1321 conf->upstream.force_ranges = NGX_CONF_UNSET; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1322 |
5008
fd84344f1df7
Fixed and improved the "*_bind" directives of proxying modules.
Ruslan Ermilov <ru@nginx.com>
parents:
4947
diff
changeset
|
1323 conf->upstream.local = NGX_CONF_UNSET_PTR; |
fd84344f1df7
Fixed and improved the "*_bind" directives of proxying modules.
Ruslan Ermilov <ru@nginx.com>
parents:
4947
diff
changeset
|
1324 |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1325 conf->upstream.connect_timeout = NGX_CONF_UNSET_MSEC; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1326 conf->upstream.send_timeout = NGX_CONF_UNSET_MSEC; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1327 conf->upstream.read_timeout = NGX_CONF_UNSET_MSEC; |
5832
d09b689911ac
Upstream: limited next_upstream time and tries (ticket #544).
Roman Arutyunyan <arut@nginx.com>
parents:
5829
diff
changeset
|
1328 conf->upstream.next_upstream_timeout = NGX_CONF_UNSET_MSEC; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1329 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1330 conf->upstream.send_lowat = NGX_CONF_UNSET_SIZE; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1331 conf->upstream.buffer_size = NGX_CONF_UNSET_SIZE; |
5883
973ee2276300
Upstream: proxy_limit_rate and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5874
diff
changeset
|
1332 conf->upstream.limit_rate = NGX_CONF_UNSET_SIZE; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1333 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1334 conf->upstream.busy_buffers_size_conf = NGX_CONF_UNSET_SIZE; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1335 conf->upstream.max_temp_file_size_conf = NGX_CONF_UNSET_SIZE; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1336 conf->upstream.temp_file_write_size_conf = NGX_CONF_UNSET_SIZE; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1337 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1338 conf->upstream.pass_request_headers = NGX_CONF_UNSET; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1339 conf->upstream.pass_request_body = NGX_CONF_UNSET; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1340 |
3568 | 1341 #if (NGX_HTTP_CACHE) |
1342 conf->upstream.cache = NGX_CONF_UNSET_PTR; | |
1343 conf->upstream.cache_min_uses = NGX_CONF_UNSET_UINT; | |
3699
b0a0686a85bb
proxy_cache_pass, fastcgi_cache_bypass, uwsgi_cache_bypass, scgi_cache_bypass
Igor Sysoev <igor@sysoev.ru>
parents:
3693
diff
changeset
|
1344 conf->upstream.cache_bypass = NGX_CONF_UNSET_PTR; |
3693
e3bcc2f4c418
fix scgi_no_cache and uwsgi_no_cache initialization
Igor Sysoev <igor@sysoev.ru>
parents:
3692
diff
changeset
|
1345 conf->upstream.no_cache = NGX_CONF_UNSET_PTR; |
3568 | 1346 conf->upstream.cache_valid = NGX_CONF_UNSET_PTR; |
4386
92deb73393f7
Cache lock support for fastcgi, scgi, uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4330
diff
changeset
|
1347 conf->upstream.cache_lock = NGX_CONF_UNSET; |
92deb73393f7
Cache lock support for fastcgi, scgi, uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4330
diff
changeset
|
1348 conf->upstream.cache_lock_timeout = NGX_CONF_UNSET_MSEC; |
5905
2f7e557eab5b
Cache: proxy_cache_lock_age and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5900
diff
changeset
|
1349 conf->upstream.cache_lock_age = NGX_CONF_UNSET_MSEC; |
5441
43ccaf8e8728
Upstream: cache revalidation with conditional requests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5393
diff
changeset
|
1350 conf->upstream.cache_revalidate = NGX_CONF_UNSET; |
3568 | 1351 #endif |
1352 | |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1353 conf->upstream.hide_headers = NGX_CONF_UNSET_PTR; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1354 conf->upstream.pass_headers = NGX_CONF_UNSET_PTR; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1355 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1356 conf->upstream.intercept_errors = NGX_CONF_UNSET; |
5662
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
1357 |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1358 #if (NGX_HTTP_SSL) |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1359 conf->upstream.ssl_session_reuse = NGX_CONF_UNSET; |
5662
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
1360 conf->upstream.ssl_server_name = NGX_CONF_UNSET; |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
1361 conf->upstream.ssl_verify = NGX_CONF_UNSET; |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
1362 conf->ssl_verify_depth = NGX_CONF_UNSET_UINT; |
5900
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
1363 conf->ssl_passwords = NGX_CONF_UNSET_PTR; |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1364 #endif |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1365 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1366 /* "uwsgi_cyclic_temp_file" is disabled */ |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1367 conf->upstream.cyclic_temp_file = 0; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1368 |
4157
9d59a8eda373
Added uwsgi_buffering and scgi_buffering directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4015
diff
changeset
|
1369 conf->upstream.change_buffering = 1; |
9d59a8eda373
Added uwsgi_buffering and scgi_buffering directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4015
diff
changeset
|
1370 |
3976
215fe9223419
update r3945 with more descriptive error message
Igor Sysoev <igor@sysoev.ru>
parents:
3879
diff
changeset
|
1371 ngx_str_set(&conf->upstream.module, "uwsgi"); |
215fe9223419
update r3945 with more descriptive error message
Igor Sysoev <igor@sysoev.ru>
parents:
3879
diff
changeset
|
1372 |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1373 return conf; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1374 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1375 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1376 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1377 static char * |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1378 ngx_http_uwsgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1379 { |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1380 ngx_http_uwsgi_loc_conf_t *prev = parent; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1381 ngx_http_uwsgi_loc_conf_t *conf = child; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1382 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1383 size_t size; |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1384 ngx_hash_init_t hash; |
3731
72cc5b789021
inherit proxy_pass, fastcgi_pass, uwsgi_pass, scgi_pass inside
Igor Sysoev <igor@sysoev.ru>
parents:
3729
diff
changeset
|
1385 ngx_http_core_loc_conf_t *clcf; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1386 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1387 if (conf->upstream.store != 0) { |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1388 ngx_conf_merge_value(conf->upstream.store, prev->upstream.store, 0); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1389 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1390 if (conf->upstream.store_lengths == NULL) { |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1391 conf->upstream.store_lengths = prev->upstream.store_lengths; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1392 conf->upstream.store_values = prev->upstream.store_values; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1393 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1394 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1395 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1396 ngx_conf_merge_uint_value(conf->upstream.store_access, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1397 prev->upstream.store_access, 0600); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1398 |
5832
d09b689911ac
Upstream: limited next_upstream time and tries (ticket #544).
Roman Arutyunyan <arut@nginx.com>
parents:
5829
diff
changeset
|
1399 ngx_conf_merge_uint_value(conf->upstream.next_upstream_tries, |
d09b689911ac
Upstream: limited next_upstream time and tries (ticket #544).
Roman Arutyunyan <arut@nginx.com>
parents:
5829
diff
changeset
|
1400 prev->upstream.next_upstream_tries, 0); |
d09b689911ac
Upstream: limited next_upstream time and tries (ticket #544).
Roman Arutyunyan <arut@nginx.com>
parents:
5829
diff
changeset
|
1401 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1402 ngx_conf_merge_value(conf->upstream.buffering, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1403 prev->upstream.buffering, 1); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1404 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1405 ngx_conf_merge_value(conf->upstream.ignore_client_abort, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1406 prev->upstream.ignore_client_abort, 0); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1407 |
5874
2aff40b3dea2
Upstream: proxy_force_ranges and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5832
diff
changeset
|
1408 ngx_conf_merge_value(conf->upstream.force_ranges, |
2aff40b3dea2
Upstream: proxy_force_ranges and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5832
diff
changeset
|
1409 prev->upstream.force_ranges, 0); |
2aff40b3dea2
Upstream: proxy_force_ranges and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5832
diff
changeset
|
1410 |
5008
fd84344f1df7
Fixed and improved the "*_bind" directives of proxying modules.
Ruslan Ermilov <ru@nginx.com>
parents:
4947
diff
changeset
|
1411 ngx_conf_merge_ptr_value(conf->upstream.local, |
fd84344f1df7
Fixed and improved the "*_bind" directives of proxying modules.
Ruslan Ermilov <ru@nginx.com>
parents:
4947
diff
changeset
|
1412 prev->upstream.local, NULL); |
fd84344f1df7
Fixed and improved the "*_bind" directives of proxying modules.
Ruslan Ermilov <ru@nginx.com>
parents:
4947
diff
changeset
|
1413 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1414 ngx_conf_merge_msec_value(conf->upstream.connect_timeout, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1415 prev->upstream.connect_timeout, 60000); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1416 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1417 ngx_conf_merge_msec_value(conf->upstream.send_timeout, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1418 prev->upstream.send_timeout, 60000); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1419 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1420 ngx_conf_merge_msec_value(conf->upstream.read_timeout, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1421 prev->upstream.read_timeout, 60000); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1422 |
5832
d09b689911ac
Upstream: limited next_upstream time and tries (ticket #544).
Roman Arutyunyan <arut@nginx.com>
parents:
5829
diff
changeset
|
1423 ngx_conf_merge_msec_value(conf->upstream.next_upstream_timeout, |
d09b689911ac
Upstream: limited next_upstream time and tries (ticket #544).
Roman Arutyunyan <arut@nginx.com>
parents:
5829
diff
changeset
|
1424 prev->upstream.next_upstream_timeout, 0); |
d09b689911ac
Upstream: limited next_upstream time and tries (ticket #544).
Roman Arutyunyan <arut@nginx.com>
parents:
5829
diff
changeset
|
1425 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1426 ngx_conf_merge_size_value(conf->upstream.send_lowat, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1427 prev->upstream.send_lowat, 0); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1428 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1429 ngx_conf_merge_size_value(conf->upstream.buffer_size, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1430 prev->upstream.buffer_size, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1431 (size_t) ngx_pagesize); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1432 |
5883
973ee2276300
Upstream: proxy_limit_rate and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5874
diff
changeset
|
1433 ngx_conf_merge_size_value(conf->upstream.limit_rate, |
973ee2276300
Upstream: proxy_limit_rate and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5874
diff
changeset
|
1434 prev->upstream.limit_rate, 0); |
973ee2276300
Upstream: proxy_limit_rate and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5874
diff
changeset
|
1435 |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1436 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1437 ngx_conf_merge_bufs_value(conf->upstream.bufs, prev->upstream.bufs, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1438 8, ngx_pagesize); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1439 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1440 if (conf->upstream.bufs.num < 2) { |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1441 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1442 "there must be at least 2 \"uwsgi_buffers\""); |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1443 return NGX_CONF_ERROR; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1444 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1445 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1446 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1447 size = conf->upstream.buffer_size; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1448 if (size < conf->upstream.bufs.size) { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1449 size = conf->upstream.bufs.size; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1450 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1451 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1452 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1453 ngx_conf_merge_size_value(conf->upstream.busy_buffers_size_conf, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1454 prev->upstream.busy_buffers_size_conf, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1455 NGX_CONF_UNSET_SIZE); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1456 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1457 if (conf->upstream.busy_buffers_size_conf == NGX_CONF_UNSET_SIZE) { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1458 conf->upstream.busy_buffers_size = 2 * size; |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1459 } else { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1460 conf->upstream.busy_buffers_size = |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1461 conf->upstream.busy_buffers_size_conf; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1462 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1463 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1464 if (conf->upstream.busy_buffers_size < size) { |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1465 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
4593
834049edae24
Fixed grammar in error messages.
Ruslan Ermilov <ru@nginx.com>
parents:
4529
diff
changeset
|
1466 "\"uwsgi_busy_buffers_size\" must be equal to or greater " |
834049edae24
Fixed grammar in error messages.
Ruslan Ermilov <ru@nginx.com>
parents:
4529
diff
changeset
|
1467 "than the maximum of the value of \"uwsgi_buffer_size\" and " |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1468 "one of the \"uwsgi_buffers\""); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1469 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1470 return NGX_CONF_ERROR; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1471 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1472 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1473 if (conf->upstream.busy_buffers_size |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1474 > (conf->upstream.bufs.num - 1) * conf->upstream.bufs.size) |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1475 { |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1476 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1477 "\"uwsgi_busy_buffers_size\" must be less than " |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1478 "the size of all \"uwsgi_buffers\" minus one buffer"); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1479 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1480 return NGX_CONF_ERROR; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1481 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1482 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1483 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1484 ngx_conf_merge_size_value(conf->upstream.temp_file_write_size_conf, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1485 prev->upstream.temp_file_write_size_conf, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1486 NGX_CONF_UNSET_SIZE); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1487 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1488 if (conf->upstream.temp_file_write_size_conf == NGX_CONF_UNSET_SIZE) { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1489 conf->upstream.temp_file_write_size = 2 * size; |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1490 } else { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1491 conf->upstream.temp_file_write_size = |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1492 conf->upstream.temp_file_write_size_conf; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1493 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1494 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1495 if (conf->upstream.temp_file_write_size < size) { |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1496 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
4593
834049edae24
Fixed grammar in error messages.
Ruslan Ermilov <ru@nginx.com>
parents:
4529
diff
changeset
|
1497 "\"uwsgi_temp_file_write_size\" must be equal to or greater than " |
834049edae24
Fixed grammar in error messages.
Ruslan Ermilov <ru@nginx.com>
parents:
4529
diff
changeset
|
1498 "the maximum of the value of \"uwsgi_buffer_size\" and " |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1499 "one of the \"uwsgi_buffers\""); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1500 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1501 return NGX_CONF_ERROR; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1502 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1503 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1504 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1505 ngx_conf_merge_size_value(conf->upstream.max_temp_file_size_conf, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1506 prev->upstream.max_temp_file_size_conf, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1507 NGX_CONF_UNSET_SIZE); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1508 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1509 if (conf->upstream.max_temp_file_size_conf == NGX_CONF_UNSET_SIZE) { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1510 conf->upstream.max_temp_file_size = 1024 * 1024 * 1024; |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1511 } else { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1512 conf->upstream.max_temp_file_size = |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1513 conf->upstream.max_temp_file_size_conf; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1514 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1515 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1516 if (conf->upstream.max_temp_file_size != 0 |
5828 | 1517 && conf->upstream.max_temp_file_size < size) |
1518 { | |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1519 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1520 "\"uwsgi_max_temp_file_size\" must be equal to zero to disable " |
4593
834049edae24
Fixed grammar in error messages.
Ruslan Ermilov <ru@nginx.com>
parents:
4529
diff
changeset
|
1521 "temporary files usage or must be equal to or greater than " |
834049edae24
Fixed grammar in error messages.
Ruslan Ermilov <ru@nginx.com>
parents:
4529
diff
changeset
|
1522 "the maximum of the value of \"uwsgi_buffer_size\" and " |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1523 "one of the \"uwsgi_buffers\""); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1524 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1525 return NGX_CONF_ERROR; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1526 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1527 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1528 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1529 ngx_conf_merge_bitmask_value(conf->upstream.ignore_headers, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1530 prev->upstream.ignore_headers, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1531 NGX_CONF_BITMASK_SET); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1532 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1533 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1534 ngx_conf_merge_bitmask_value(conf->upstream.next_upstream, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1535 prev->upstream.next_upstream, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1536 (NGX_CONF_BITMASK_SET |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1537 |NGX_HTTP_UPSTREAM_FT_ERROR |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1538 |NGX_HTTP_UPSTREAM_FT_TIMEOUT)); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1539 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1540 if (conf->upstream.next_upstream & NGX_HTTP_UPSTREAM_FT_OFF) { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1541 conf->upstream.next_upstream = NGX_CONF_BITMASK_SET |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1542 |NGX_HTTP_UPSTREAM_FT_OFF; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1543 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1544 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1545 if (ngx_conf_merge_path_value(cf, &conf->upstream.temp_path, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1546 prev->upstream.temp_path, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1547 &ngx_http_uwsgi_temp_path) |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1548 != NGX_OK) |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1549 { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1550 return NGX_CONF_ERROR; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1551 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1552 |
3568 | 1553 #if (NGX_HTTP_CACHE) |
1554 | |
1555 ngx_conf_merge_ptr_value(conf->upstream.cache, | |
1556 prev->upstream.cache, NULL); | |
1557 | |
1558 if (conf->upstream.cache && conf->upstream.cache->data == NULL) { | |
1559 ngx_shm_zone_t *shm_zone; | |
1560 | |
1561 shm_zone = conf->upstream.cache; | |
1562 | |
1563 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
1564 "\"uwsgi_cache\" zone \"%V\" is unknown", | |
1565 &shm_zone->shm.name); | |
1566 | |
1567 return NGX_CONF_ERROR; | |
1568 } | |
1569 | |
1570 ngx_conf_merge_uint_value(conf->upstream.cache_min_uses, | |
1571 prev->upstream.cache_min_uses, 1); | |
1572 | |
1573 ngx_conf_merge_bitmask_value(conf->upstream.cache_use_stale, | |
1574 prev->upstream.cache_use_stale, | |
1575 (NGX_CONF_BITMASK_SET | |
1576 |NGX_HTTP_UPSTREAM_FT_OFF)); | |
1577 | |
1578 if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_OFF) { | |
1579 conf->upstream.cache_use_stale = NGX_CONF_BITMASK_SET | |
1580 |NGX_HTTP_UPSTREAM_FT_OFF; | |
1581 } | |
1582 | |
4401
d45742815c90
Fixed proxy_cache_use_stale in "no live upstreams" case.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4386
diff
changeset
|
1583 if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_ERROR) { |
d45742815c90
Fixed proxy_cache_use_stale in "no live upstreams" case.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4386
diff
changeset
|
1584 conf->upstream.cache_use_stale |= NGX_HTTP_UPSTREAM_FT_NOLIVE; |
d45742815c90
Fixed proxy_cache_use_stale in "no live upstreams" case.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4386
diff
changeset
|
1585 } |
d45742815c90
Fixed proxy_cache_use_stale in "no live upstreams" case.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4386
diff
changeset
|
1586 |
3568 | 1587 if (conf->upstream.cache_methods == 0) { |
1588 conf->upstream.cache_methods = prev->upstream.cache_methods; | |
1589 } | |
1590 | |
1591 conf->upstream.cache_methods |= NGX_HTTP_GET|NGX_HTTP_HEAD; | |
1592 | |
3699
b0a0686a85bb
proxy_cache_pass, fastcgi_cache_bypass, uwsgi_cache_bypass, scgi_cache_bypass
Igor Sysoev <igor@sysoev.ru>
parents:
3693
diff
changeset
|
1593 ngx_conf_merge_ptr_value(conf->upstream.cache_bypass, |
b0a0686a85bb
proxy_cache_pass, fastcgi_cache_bypass, uwsgi_cache_bypass, scgi_cache_bypass
Igor Sysoev <igor@sysoev.ru>
parents:
3693
diff
changeset
|
1594 prev->upstream.cache_bypass, NULL); |
b0a0686a85bb
proxy_cache_pass, fastcgi_cache_bypass, uwsgi_cache_bypass, scgi_cache_bypass
Igor Sysoev <igor@sysoev.ru>
parents:
3693
diff
changeset
|
1595 |
3568 | 1596 ngx_conf_merge_ptr_value(conf->upstream.no_cache, |
1597 prev->upstream.no_cache, NULL); | |
1598 | |
1599 ngx_conf_merge_ptr_value(conf->upstream.cache_valid, | |
1600 prev->upstream.cache_valid, NULL); | |
1601 | |
1602 if (conf->cache_key.value.data == NULL) { | |
1603 conf->cache_key = prev->cache_key; | |
1604 } | |
1605 | |
5829
906530c9ffd2
Added warning about unset cache keys.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5828
diff
changeset
|
1606 if (conf->upstream.cache && conf->cache_key.value.data == NULL) { |
906530c9ffd2
Added warning about unset cache keys.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5828
diff
changeset
|
1607 ngx_conf_log_error(NGX_LOG_WARN, cf, 0, |
906530c9ffd2
Added warning about unset cache keys.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5828
diff
changeset
|
1608 "no \"uwsgi_cache_key\" for \"uwsgi_cache\""); |
906530c9ffd2
Added warning about unset cache keys.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5828
diff
changeset
|
1609 } |
906530c9ffd2
Added warning about unset cache keys.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5828
diff
changeset
|
1610 |
4386
92deb73393f7
Cache lock support for fastcgi, scgi, uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4330
diff
changeset
|
1611 ngx_conf_merge_value(conf->upstream.cache_lock, |
92deb73393f7
Cache lock support for fastcgi, scgi, uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4330
diff
changeset
|
1612 prev->upstream.cache_lock, 0); |
92deb73393f7
Cache lock support for fastcgi, scgi, uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4330
diff
changeset
|
1613 |
92deb73393f7
Cache lock support for fastcgi, scgi, uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4330
diff
changeset
|
1614 ngx_conf_merge_msec_value(conf->upstream.cache_lock_timeout, |
92deb73393f7
Cache lock support for fastcgi, scgi, uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4330
diff
changeset
|
1615 prev->upstream.cache_lock_timeout, 5000); |
92deb73393f7
Cache lock support for fastcgi, scgi, uwsgi.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4330
diff
changeset
|
1616 |
5905
2f7e557eab5b
Cache: proxy_cache_lock_age and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5900
diff
changeset
|
1617 ngx_conf_merge_msec_value(conf->upstream.cache_lock_age, |
2f7e557eab5b
Cache: proxy_cache_lock_age and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5900
diff
changeset
|
1618 prev->upstream.cache_lock_age, 5000); |
2f7e557eab5b
Cache: proxy_cache_lock_age and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
5900
diff
changeset
|
1619 |
5441
43ccaf8e8728
Upstream: cache revalidation with conditional requests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5393
diff
changeset
|
1620 ngx_conf_merge_value(conf->upstream.cache_revalidate, |
43ccaf8e8728
Upstream: cache revalidation with conditional requests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5393
diff
changeset
|
1621 prev->upstream.cache_revalidate, 0); |
43ccaf8e8728
Upstream: cache revalidation with conditional requests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5393
diff
changeset
|
1622 |
3568 | 1623 #endif |
1624 | |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1625 ngx_conf_merge_value(conf->upstream.pass_request_headers, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1626 prev->upstream.pass_request_headers, 1); |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1627 ngx_conf_merge_value(conf->upstream.pass_request_body, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1628 prev->upstream.pass_request_body, 1); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1629 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1630 ngx_conf_merge_value(conf->upstream.intercept_errors, |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1631 prev->upstream.intercept_errors, 0); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1632 |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1633 #if (NGX_HTTP_SSL) |
5662
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
1634 |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1635 ngx_conf_merge_value(conf->upstream.ssl_session_reuse, |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1636 prev->upstream.ssl_session_reuse, 1); |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1637 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1638 ngx_conf_merge_bitmask_value(conf->ssl_protocols, prev->ssl_protocols, |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1639 (NGX_CONF_BITMASK_SET|NGX_SSL_SSLv3 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1640 |NGX_SSL_TLSv1|NGX_SSL_TLSv1_1 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1641 |NGX_SSL_TLSv1_2)); |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1642 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1643 ngx_conf_merge_str_value(conf->ssl_ciphers, prev->ssl_ciphers, |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1644 "DEFAULT"); |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1645 |
5662
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
1646 if (conf->upstream.ssl_name == NULL) { |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
1647 conf->upstream.ssl_name = prev->upstream.ssl_name; |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
1648 } |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
1649 |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
1650 ngx_conf_merge_value(conf->upstream.ssl_server_name, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
1651 prev->upstream.ssl_server_name, 0); |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
1652 ngx_conf_merge_value(conf->upstream.ssl_verify, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
1653 prev->upstream.ssl_verify, 0); |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
1654 ngx_conf_merge_uint_value(conf->ssl_verify_depth, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
1655 prev->ssl_verify_depth, 1); |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
1656 ngx_conf_merge_str_value(conf->ssl_trusted_certificate, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
1657 prev->ssl_trusted_certificate, ""); |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
1658 ngx_conf_merge_str_value(conf->ssl_crl, prev->ssl_crl, ""); |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
1659 |
5900
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
1660 ngx_conf_merge_str_value(conf->ssl_certificate, |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
1661 prev->ssl_certificate, ""); |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
1662 ngx_conf_merge_str_value(conf->ssl_certificate_key, |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
1663 prev->ssl_certificate_key, ""); |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
1664 ngx_conf_merge_ptr_value(conf->ssl_passwords, prev->ssl_passwords, NULL); |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
1665 |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1666 if (conf->ssl && ngx_http_uwsgi_set_ssl(cf, conf) != NGX_OK) { |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1667 return NGX_CONF_ERROR; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1668 } |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1669 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1670 if (conf->upstream.ssl == NULL) { |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1671 conf->upstream.ssl = prev->upstream.ssl; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1672 } |
5662
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
1673 |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1674 #endif |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1675 |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1676 ngx_conf_merge_str_value(conf->uwsgi_string, prev->uwsgi_string, ""); |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1677 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1678 hash.max_size = 512; |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1679 hash.bucket_size = ngx_align(64, ngx_cacheline_size); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1680 hash.name = "uwsgi_hide_headers_hash"; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1681 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1682 if (ngx_http_upstream_hide_headers_hash(cf, &conf->upstream, |
3670
2728c4e4a9ae
do not use a cache headers set to hide
Igor Sysoev <igor@sysoev.ru>
parents:
3667
diff
changeset
|
1683 &prev->upstream, ngx_http_uwsgi_hide_headers, &hash) |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1684 != NGX_OK) |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1685 { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1686 return NGX_CONF_ERROR; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1687 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1688 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1689 if (conf->upstream.upstream == NULL) { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1690 conf->upstream.upstream = prev->upstream.upstream; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1691 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1692 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1693 if (conf->uwsgi_lengths == NULL) { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1694 conf->uwsgi_lengths = prev->uwsgi_lengths; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1695 conf->uwsgi_values = prev->uwsgi_values; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1696 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1697 |
3731
72cc5b789021
inherit proxy_pass, fastcgi_pass, uwsgi_pass, scgi_pass inside
Igor Sysoev <igor@sysoev.ru>
parents:
3729
diff
changeset
|
1698 if (conf->upstream.upstream || conf->uwsgi_lengths) { |
72cc5b789021
inherit proxy_pass, fastcgi_pass, uwsgi_pass, scgi_pass inside
Igor Sysoev <igor@sysoev.ru>
parents:
3729
diff
changeset
|
1699 clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); |
72cc5b789021
inherit proxy_pass, fastcgi_pass, uwsgi_pass, scgi_pass inside
Igor Sysoev <igor@sysoev.ru>
parents:
3729
diff
changeset
|
1700 if (clcf->handler == NULL && clcf->lmt_excpt) { |
72cc5b789021
inherit proxy_pass, fastcgi_pass, uwsgi_pass, scgi_pass inside
Igor Sysoev <igor@sysoev.ru>
parents:
3729
diff
changeset
|
1701 clcf->handler = ngx_http_uwsgi_handler; |
72cc5b789021
inherit proxy_pass, fastcgi_pass, uwsgi_pass, scgi_pass inside
Igor Sysoev <igor@sysoev.ru>
parents:
3729
diff
changeset
|
1702 } |
72cc5b789021
inherit proxy_pass, fastcgi_pass, uwsgi_pass, scgi_pass inside
Igor Sysoev <igor@sysoev.ru>
parents:
3729
diff
changeset
|
1703 } |
72cc5b789021
inherit proxy_pass, fastcgi_pass, uwsgi_pass, scgi_pass inside
Igor Sysoev <igor@sysoev.ru>
parents:
3729
diff
changeset
|
1704 |
3552
40eba0271b1d
improve uwsgi_modifierX processing:
Igor Sysoev <igor@sysoev.ru>
parents:
3551
diff
changeset
|
1705 ngx_conf_merge_uint_value(conf->modifier1, prev->modifier1, 0); |
40eba0271b1d
improve uwsgi_modifierX processing:
Igor Sysoev <igor@sysoev.ru>
parents:
3551
diff
changeset
|
1706 ngx_conf_merge_uint_value(conf->modifier2, prev->modifier2, 0); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1707 |
5907
195561ef367f
Upstream: moved header initializations to separate functions.
Roman Arutyunyan <arut@nginx.com>
parents:
5905
diff
changeset
|
1708 if (conf->params_source == NULL) { |
195561ef367f
Upstream: moved header initializations to separate functions.
Roman Arutyunyan <arut@nginx.com>
parents:
5905
diff
changeset
|
1709 conf->params_source = prev->params_source; |
195561ef367f
Upstream: moved header initializations to separate functions.
Roman Arutyunyan <arut@nginx.com>
parents:
5905
diff
changeset
|
1710 |
195561ef367f
Upstream: moved header initializations to separate functions.
Roman Arutyunyan <arut@nginx.com>
parents:
5905
diff
changeset
|
1711 #if (NGX_HTTP_CACHE) |
195561ef367f
Upstream: moved header initializations to separate functions.
Roman Arutyunyan <arut@nginx.com>
parents:
5905
diff
changeset
|
1712 if ((conf->upstream.cache == NULL) == (prev->upstream.cache == NULL)) |
195561ef367f
Upstream: moved header initializations to separate functions.
Roman Arutyunyan <arut@nginx.com>
parents:
5905
diff
changeset
|
1713 #endif |
195561ef367f
Upstream: moved header initializations to separate functions.
Roman Arutyunyan <arut@nginx.com>
parents:
5905
diff
changeset
|
1714 { |
195561ef367f
Upstream: moved header initializations to separate functions.
Roman Arutyunyan <arut@nginx.com>
parents:
5905
diff
changeset
|
1715 conf->flushes = prev->flushes; |
195561ef367f
Upstream: moved header initializations to separate functions.
Roman Arutyunyan <arut@nginx.com>
parents:
5905
diff
changeset
|
1716 conf->params_len = prev->params_len; |
195561ef367f
Upstream: moved header initializations to separate functions.
Roman Arutyunyan <arut@nginx.com>
parents:
5905
diff
changeset
|
1717 conf->params = prev->params; |
195561ef367f
Upstream: moved header initializations to separate functions.
Roman Arutyunyan <arut@nginx.com>
parents:
5905
diff
changeset
|
1718 conf->headers_hash = prev->headers_hash; |
195561ef367f
Upstream: moved header initializations to separate functions.
Roman Arutyunyan <arut@nginx.com>
parents:
5905
diff
changeset
|
1719 conf->header_params = prev->header_params; |
195561ef367f
Upstream: moved header initializations to separate functions.
Roman Arutyunyan <arut@nginx.com>
parents:
5905
diff
changeset
|
1720 } |
195561ef367f
Upstream: moved header initializations to separate functions.
Roman Arutyunyan <arut@nginx.com>
parents:
5905
diff
changeset
|
1721 } |
195561ef367f
Upstream: moved header initializations to separate functions.
Roman Arutyunyan <arut@nginx.com>
parents:
5905
diff
changeset
|
1722 |
195561ef367f
Upstream: moved header initializations to separate functions.
Roman Arutyunyan <arut@nginx.com>
parents:
5905
diff
changeset
|
1723 if (ngx_http_uwsgi_init_params(cf, conf) != NGX_OK) { |
4277
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1724 return NGX_CONF_ERROR; |
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1725 } |
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1726 |
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1727 return NGX_CONF_OK; |
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1728 } |
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1729 |
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1730 |
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1731 static ngx_int_t |
5907
195561ef367f
Upstream: moved header initializations to separate functions.
Roman Arutyunyan <arut@nginx.com>
parents:
5905
diff
changeset
|
1732 ngx_http_uwsgi_init_params(ngx_conf_t *cf, ngx_http_uwsgi_loc_conf_t *conf) |
4277
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1733 { |
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1734 u_char *p; |
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1735 size_t size; |
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1736 uintptr_t *code; |
4278
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1737 ngx_uint_t i, nsrc; |
4277
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1738 ngx_array_t headers_names; |
4278
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1739 #if (NGX_HTTP_CACHE) |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1740 ngx_array_t params_merged; |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1741 #endif |
4277
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1742 ngx_hash_key_t *hk; |
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1743 ngx_hash_init_t hash; |
4330
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
1744 ngx_http_upstream_param_t *src; |
4277
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1745 ngx_http_script_compile_t sc; |
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1746 ngx_http_script_copy_code_t *copy; |
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1747 |
5907
195561ef367f
Upstream: moved header initializations to separate functions.
Roman Arutyunyan <arut@nginx.com>
parents:
5905
diff
changeset
|
1748 if (conf->headers_hash.buckets) { |
195561ef367f
Upstream: moved header initializations to separate functions.
Roman Arutyunyan <arut@nginx.com>
parents:
5905
diff
changeset
|
1749 return NGX_OK; |
4278
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1750 } |
3568 | 1751 |
4278
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1752 if (conf->params_source == NULL |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1753 #if (NGX_HTTP_CACHE) |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1754 && (conf->upstream.cache == NULL) |
3568 | 1755 #endif |
4278
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1756 ) |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1757 { |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1758 conf->headers_hash.buckets = (void *) 1; |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1759 return NGX_OK; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1760 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1761 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1762 conf->params_len = ngx_array_create(cf->pool, 64, 1); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1763 if (conf->params_len == NULL) { |
4277
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1764 return NGX_ERROR; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1765 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1766 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1767 conf->params = ngx_array_create(cf->pool, 512, 1); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1768 if (conf->params == NULL) { |
4277
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1769 return NGX_ERROR; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1770 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1771 |
3566
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1772 if (ngx_array_init(&headers_names, cf->temp_pool, 4, sizeof(ngx_hash_key_t)) |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1773 != NGX_OK) |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1774 { |
4277
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1775 return NGX_ERROR; |
3566
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1776 } |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1777 |
4278
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1778 if (conf->params_source) { |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1779 src = conf->params_source->elts; |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1780 nsrc = conf->params_source->nelts; |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1781 |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1782 } else { |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1783 src = NULL; |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1784 nsrc = 0; |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1785 } |
3568 | 1786 |
1787 #if (NGX_HTTP_CACHE) | |
1788 | |
1789 if (conf->upstream.cache) { | |
4330
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
1790 ngx_keyval_t *h; |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
1791 ngx_http_upstream_param_t *s; |
3568 | 1792 |
4330
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
1793 if (ngx_array_init(¶ms_merged, cf->temp_pool, 4, |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
1794 sizeof(ngx_http_upstream_param_t)) |
4278
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1795 != NGX_OK) |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1796 { |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1797 return NGX_ERROR; |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1798 } |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1799 |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1800 for (i = 0; i < nsrc; i++) { |
3568 | 1801 |
4278
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1802 s = ngx_array_push(¶ms_merged); |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1803 if (s == NULL) { |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1804 return NGX_ERROR; |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1805 } |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1806 |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1807 *s = src[i]; |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1808 } |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1809 |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1810 h = ngx_http_uwsgi_cache_headers; |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1811 |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1812 while (h->key.len) { |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1813 |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1814 src = params_merged.elts; |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1815 nsrc = params_merged.nelts; |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1816 |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1817 for (i = 0; i < nsrc; i++) { |
3568 | 1818 if (ngx_strcasecmp(h->key.data, src[i].key.data) == 0) { |
1819 goto next; | |
1820 } | |
1821 } | |
1822 | |
4278
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1823 s = ngx_array_push(¶ms_merged); |
3568 | 1824 if (s == NULL) { |
4277
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1825 return NGX_ERROR; |
3568 | 1826 } |
1827 | |
4330
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
1828 s->key = h->key; |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
1829 s->value = h->value; |
5451
e68af4e3396f
Upstream: skip empty cache headers.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5441
diff
changeset
|
1830 s->skip_empty = 1; |
3568 | 1831 |
1832 next: | |
1833 | |
1834 h++; | |
1835 } | |
4278
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1836 |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1837 src = params_merged.elts; |
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1838 nsrc = params_merged.nelts; |
3568 | 1839 } |
1840 | |
1841 #endif | |
1842 | |
4278
f57229cba7ad
Fixed fastcgi/scgi/uwsgi_param inheritance.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4277
diff
changeset
|
1843 for (i = 0; i < nsrc; i++) { |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1844 |
3566
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1845 if (src[i].key.len > sizeof("HTTP_") - 1 |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1846 && ngx_strncmp(src[i].key.data, "HTTP_", sizeof("HTTP_") - 1) == 0) |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1847 { |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1848 hk = ngx_array_push(&headers_names); |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1849 if (hk == NULL) { |
4277
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1850 return NGX_ERROR; |
3566
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1851 } |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1852 |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1853 hk->key.len = src[i].key.len - 5; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1854 hk->key.data = src[i].key.data + 5; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1855 hk->key_hash = ngx_hash_key_lc(hk->key.data, hk->key.len); |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1856 hk->value = (void *) 1; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1857 |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1858 if (src[i].value.len == 0) { |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1859 continue; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1860 } |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1861 } |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1862 |
3548
fc7541a6959d
fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents:
3547
diff
changeset
|
1863 copy = ngx_array_push_n(conf->params_len, |
fc7541a6959d
fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents:
3547
diff
changeset
|
1864 sizeof(ngx_http_script_copy_code_t)); |
fc7541a6959d
fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents:
3547
diff
changeset
|
1865 if (copy == NULL) { |
4277
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1866 return NGX_ERROR; |
3548
fc7541a6959d
fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents:
3547
diff
changeset
|
1867 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1868 |
3548
fc7541a6959d
fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents:
3547
diff
changeset
|
1869 copy->code = (ngx_http_script_code_pt) ngx_http_script_copy_len_code; |
fc7541a6959d
fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents:
3547
diff
changeset
|
1870 copy->len = src[i].key.len; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1871 |
4330
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
1872 copy = ngx_array_push_n(conf->params_len, |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
1873 sizeof(ngx_http_script_copy_code_t)); |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
1874 if (copy == NULL) { |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
1875 return NGX_ERROR; |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
1876 } |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
1877 |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
1878 copy->code = (ngx_http_script_code_pt) ngx_http_script_copy_len_code; |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
1879 copy->len = src[i].skip_empty; |
5ee5ddec17b1
uwsgi: added "if_not_empty" flag support to the "uwsgi_param" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
4278
diff
changeset
|
1880 |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1881 |
3548
fc7541a6959d
fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents:
3547
diff
changeset
|
1882 size = (sizeof(ngx_http_script_copy_code_t) |
fc7541a6959d
fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents:
3547
diff
changeset
|
1883 + src[i].key.len + sizeof(uintptr_t) - 1) |
fc7541a6959d
fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents:
3547
diff
changeset
|
1884 & ~(sizeof(uintptr_t) - 1); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1885 |
3548
fc7541a6959d
fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents:
3547
diff
changeset
|
1886 copy = ngx_array_push_n(conf->params, size); |
fc7541a6959d
fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents:
3547
diff
changeset
|
1887 if (copy == NULL) { |
4277
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1888 return NGX_ERROR; |
3548
fc7541a6959d
fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents:
3547
diff
changeset
|
1889 } |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1890 |
3548
fc7541a6959d
fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents:
3547
diff
changeset
|
1891 copy->code = ngx_http_script_copy_code; |
fc7541a6959d
fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents:
3547
diff
changeset
|
1892 copy->len = src[i].key.len; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1893 |
3548
fc7541a6959d
fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents:
3547
diff
changeset
|
1894 p = (u_char *) copy + sizeof(ngx_http_script_copy_code_t); |
fc7541a6959d
fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents:
3547
diff
changeset
|
1895 ngx_memcpy(p, src[i].key.data, src[i].key.len); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1896 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1897 |
3548
fc7541a6959d
fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents:
3547
diff
changeset
|
1898 ngx_memzero(&sc, sizeof(ngx_http_script_compile_t)); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1899 |
3548
fc7541a6959d
fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents:
3547
diff
changeset
|
1900 sc.cf = cf; |
fc7541a6959d
fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents:
3547
diff
changeset
|
1901 sc.source = &src[i].value; |
fc7541a6959d
fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents:
3547
diff
changeset
|
1902 sc.flushes = &conf->flushes; |
fc7541a6959d
fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents:
3547
diff
changeset
|
1903 sc.lengths = &conf->params_len; |
fc7541a6959d
fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents:
3547
diff
changeset
|
1904 sc.values = &conf->params; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1905 |
3548
fc7541a6959d
fix the previous commit when value is static string: remove the special
Igor Sysoev <igor@sysoev.ru>
parents:
3547
diff
changeset
|
1906 if (ngx_http_script_compile(&sc) != NGX_OK) { |
4277
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1907 return NGX_ERROR; |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1908 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1909 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1910 code = ngx_array_push_n(conf->params_len, sizeof(uintptr_t)); |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1911 if (code == NULL) { |
4277
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1912 return NGX_ERROR; |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1913 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1914 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1915 *code = (uintptr_t) NULL; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1916 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1917 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1918 code = ngx_array_push_n(conf->params, sizeof(uintptr_t)); |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1919 if (code == NULL) { |
4277
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1920 return NGX_ERROR; |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1921 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1922 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1923 *code = (uintptr_t) NULL; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1924 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1925 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1926 code = ngx_array_push_n(conf->params_len, sizeof(uintptr_t)); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1927 if (code == NULL) { |
4277
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1928 return NGX_ERROR; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1929 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1930 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1931 *code = (uintptr_t) NULL; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1932 |
3566
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1933 conf->header_params = headers_names.nelts; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1934 |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1935 hash.hash = &conf->headers_hash; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1936 hash.key = ngx_hash_key_lc; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1937 hash.max_size = 512; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1938 hash.bucket_size = 64; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1939 hash.name = "uwsgi_params_hash"; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1940 hash.pool = cf->pool; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1941 hash.temp_pool = NULL; |
b81d44244cb1
allow uwsgi_param to override client headers using HTTP_ parameters
Igor Sysoev <igor@sysoev.ru>
parents:
3565
diff
changeset
|
1942 |
4277
e4b8255e44c3
Separate functions to merge fastcgi/scgi/uwsgi params.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4157
diff
changeset
|
1943 return ngx_hash_init(&hash, headers_names.elts, headers_names.nelts); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1944 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1945 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1946 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1947 static char * |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1948 ngx_http_uwsgi_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1949 { |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1950 ngx_http_uwsgi_loc_conf_t *uwcf = conf; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1951 |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1952 size_t add; |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1953 ngx_url_t u; |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1954 ngx_str_t *value, *url; |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1955 ngx_uint_t n; |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1956 ngx_http_core_loc_conf_t *clcf; |
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1957 ngx_http_script_compile_t sc; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1958 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1959 if (uwcf->upstream.upstream || uwcf->uwsgi_lengths) { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1960 return "is duplicate"; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1961 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1962 |
5758
f3df4e420ae7
Style: remove whitespace between function name and parentheses.
Piotr Sikora <piotr@cloudflare.com>
parents:
5738
diff
changeset
|
1963 clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1964 clcf->handler = ngx_http_uwsgi_handler; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1965 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1966 value = cf->args->elts; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1967 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1968 url = &value[1]; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1969 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1970 n = ngx_http_script_variables_count(url); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1971 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1972 if (n) { |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1973 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1974 ngx_memzero(&sc, sizeof(ngx_http_script_compile_t)); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1975 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1976 sc.cf = cf; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1977 sc.source = url; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1978 sc.lengths = &uwcf->uwsgi_lengths; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1979 sc.values = &uwcf->uwsgi_values; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1980 sc.variables = n; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1981 sc.complete_lengths = 1; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1982 sc.complete_values = 1; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1983 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
1984 if (ngx_http_script_compile(&sc) != NGX_OK) { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1985 return NGX_CONF_ERROR; |
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1986 } |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1987 |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1988 #if (NGX_HTTP_SSL) |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1989 uwcf->ssl = 1; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1990 #endif |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1991 |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
1992 return NGX_CONF_OK; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1993 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
1994 |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1995 if (ngx_strncasecmp(url->data, (u_char *) "uwsgi://", 8) == 0) { |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1996 add = 8; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1997 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1998 } else if (ngx_strncasecmp(url->data, (u_char *) "suwsgi://", 9) == 0) { |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
1999 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2000 #if (NGX_HTTP_SSL) |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2001 add = 9; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2002 uwcf->ssl = 1; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2003 #else |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2004 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2005 "suwsgi protocol requires SSL support"); |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2006 return NGX_CONF_ERROR; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2007 #endif |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2008 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2009 } else { |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2010 add = 0; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2011 } |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2012 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
2013 ngx_memzero(&u, sizeof(ngx_url_t)); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
2014 |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2015 u.url.len = url->len - add; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2016 u.url.data = url->data + add; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
2017 u.no_resolve = 1; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
2018 |
3543
e132566a942e
fix style, some names, and building by MSVC8
Igor Sysoev <igor@sysoev.ru>
parents:
3542
diff
changeset
|
2019 uwcf->upstream.upstream = ngx_http_upstream_add(cf, &u, 0); |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
2020 if (uwcf->upstream.upstream == NULL) { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
2021 return NGX_CONF_ERROR; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
2022 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
2023 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
2024 if (clcf->name.data[clcf->name.len - 1] == '/') { |
3542
9bf51b3fc1c1
style fix: remove tabs and trailing spaces
Igor Sysoev <igor@sysoev.ru>
parents:
3541
diff
changeset
|
2025 clcf->auto_redirect = 1; |
3541
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
2026 } |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
2027 |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
2028 return NGX_CONF_OK; |
21452748d165
import original ngx_http_uwsgi_module version
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
2029 } |
3565 | 2030 |
2031 | |
2032 static char * | |
2033 ngx_http_uwsgi_store(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | |
2034 { | |
2035 ngx_http_uwsgi_loc_conf_t *uwcf = conf; | |
2036 | |
2037 ngx_str_t *value; | |
2038 ngx_http_script_compile_t sc; | |
2039 | |
2040 if (uwcf->upstream.store != NGX_CONF_UNSET || uwcf->upstream.store_lengths) | |
2041 { | |
2042 return "is duplicate"; | |
2043 } | |
2044 | |
2045 value = cf->args->elts; | |
2046 | |
3568 | 2047 if (ngx_strcmp(value[1].data, "off") == 0) { |
2048 uwcf->upstream.store = 0; | |
3565 | 2049 return NGX_CONF_OK; |
2050 } | |
2051 | |
3568 | 2052 #if (NGX_HTTP_CACHE) |
2053 | |
2054 if (uwcf->upstream.cache != NGX_CONF_UNSET_PTR | |
2055 && uwcf->upstream.cache != NULL) | |
2056 { | |
2057 return "is incompatible with \"uwsgi_cache\""; | |
2058 } | |
2059 | |
2060 #endif | |
2061 | |
2062 if (ngx_strcmp(value[1].data, "on") == 0) { | |
2063 uwcf->upstream.store = 1; | |
3565 | 2064 return NGX_CONF_OK; |
2065 } | |
2066 | |
2067 /* include the terminating '\0' into script */ | |
2068 value[1].len++; | |
2069 | |
2070 ngx_memzero(&sc, sizeof(ngx_http_script_compile_t)); | |
2071 | |
2072 sc.cf = cf; | |
2073 sc.source = &value[1]; | |
2074 sc.lengths = &uwcf->upstream.store_lengths; | |
2075 sc.values = &uwcf->upstream.store_values; | |
5496
9d056f10fb99
Style: removed surplus semicolons.
Valentin Bartenev <vbart@nginx.com>
parents:
5467
diff
changeset
|
2076 sc.variables = ngx_http_script_variables_count(&value[1]); |
3565 | 2077 sc.complete_lengths = 1; |
2078 sc.complete_values = 1; | |
2079 | |
2080 if (ngx_http_script_compile(&sc) != NGX_OK) { | |
2081 return NGX_CONF_ERROR; | |
2082 } | |
2083 | |
2084 return NGX_CONF_OK; | |
2085 } | |
3568 | 2086 |
2087 | |
2088 #if (NGX_HTTP_CACHE) | |
2089 | |
2090 static char * | |
2091 ngx_http_uwsgi_cache(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | |
2092 { | |
2093 ngx_http_uwsgi_loc_conf_t *uwcf = conf; | |
2094 | |
2095 ngx_str_t *value; | |
2096 | |
2097 value = cf->args->elts; | |
2098 | |
2099 if (uwcf->upstream.cache != NGX_CONF_UNSET_PTR) { | |
2100 return "is duplicate"; | |
2101 } | |
2102 | |
2103 if (ngx_strcmp(value[1].data, "off") == 0) { | |
2104 uwcf->upstream.cache = NULL; | |
2105 return NGX_CONF_OK; | |
2106 } | |
2107 | |
2108 if (uwcf->upstream.store > 0 || uwcf->upstream.store_lengths) { | |
2109 return "is incompatible with \"uwsgi_store\""; | |
2110 } | |
2111 | |
2112 uwcf->upstream.cache = ngx_shared_memory_add(cf, &value[1], 0, | |
2113 &ngx_http_uwsgi_module); | |
2114 if (uwcf->upstream.cache == NULL) { | |
2115 return NGX_CONF_ERROR; | |
2116 } | |
2117 | |
2118 return NGX_CONF_OK; | |
2119 } | |
2120 | |
2121 | |
2122 static char * | |
2123 ngx_http_uwsgi_cache_key(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | |
2124 { | |
2125 ngx_http_uwsgi_loc_conf_t *uwcf = conf; | |
2126 | |
2127 ngx_str_t *value; | |
2128 ngx_http_compile_complex_value_t ccv; | |
2129 | |
2130 value = cf->args->elts; | |
2131 | |
4947
4251e72b8bb4
Allow the complex value to be defined as an empty string.
Ruslan Ermilov <ru@nginx.com>
parents:
4615
diff
changeset
|
2132 if (uwcf->cache_key.value.data) { |
3568 | 2133 return "is duplicate"; |
2134 } | |
2135 | |
2136 ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); | |
2137 | |
2138 ccv.cf = cf; | |
2139 ccv.value = &value[1]; | |
2140 ccv.complex_value = &uwcf->cache_key; | |
2141 | |
2142 if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { | |
2143 return NGX_CONF_ERROR; | |
2144 } | |
2145 | |
2146 return NGX_CONF_OK; | |
2147 } | |
2148 | |
2149 #endif | |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2150 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2151 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2152 #if (NGX_HTTP_SSL) |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2153 |
5900
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2154 static char * |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2155 ngx_http_uwsgi_ssl_password_file(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2156 { |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2157 ngx_http_uwsgi_loc_conf_t *uwcf = conf; |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2158 |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2159 ngx_str_t *value; |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2160 |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2161 if (uwcf->ssl_passwords != NGX_CONF_UNSET_PTR) { |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2162 return "is duplicate"; |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2163 } |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2164 |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2165 value = cf->args->elts; |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2166 |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2167 uwcf->ssl_passwords = ngx_ssl_read_password_file(cf, &value[1]); |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2168 |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2169 if (uwcf->ssl_passwords == NULL) { |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2170 return NGX_CONF_ERROR; |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2171 } |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2172 |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2173 return NGX_CONF_OK; |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2174 } |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2175 |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2176 |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2177 static ngx_int_t |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2178 ngx_http_uwsgi_set_ssl(ngx_conf_t *cf, ngx_http_uwsgi_loc_conf_t *uwcf) |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2179 { |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2180 ngx_pool_cleanup_t *cln; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2181 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2182 uwcf->upstream.ssl = ngx_pcalloc(cf->pool, sizeof(ngx_ssl_t)); |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2183 if (uwcf->upstream.ssl == NULL) { |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2184 return NGX_ERROR; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2185 } |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2186 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2187 uwcf->upstream.ssl->log = cf->log; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2188 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2189 if (ngx_ssl_create(uwcf->upstream.ssl, uwcf->ssl_protocols, NULL) |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2190 != NGX_OK) |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2191 { |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2192 return NGX_ERROR; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2193 } |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2194 |
5659
3fb6615bb87f
Upstream: plugged potential memory leak on reload.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5575
diff
changeset
|
2195 cln = ngx_pool_cleanup_add(cf->pool, 0); |
3fb6615bb87f
Upstream: plugged potential memory leak on reload.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5575
diff
changeset
|
2196 if (cln == NULL) { |
3fb6615bb87f
Upstream: plugged potential memory leak on reload.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5575
diff
changeset
|
2197 return NGX_ERROR; |
3fb6615bb87f
Upstream: plugged potential memory leak on reload.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5575
diff
changeset
|
2198 } |
3fb6615bb87f
Upstream: plugged potential memory leak on reload.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5575
diff
changeset
|
2199 |
3fb6615bb87f
Upstream: plugged potential memory leak on reload.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5575
diff
changeset
|
2200 cln->handler = ngx_ssl_cleanup_ctx; |
3fb6615bb87f
Upstream: plugged potential memory leak on reload.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5575
diff
changeset
|
2201 cln->data = uwcf->upstream.ssl; |
3fb6615bb87f
Upstream: plugged potential memory leak on reload.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5575
diff
changeset
|
2202 |
5900
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2203 if (uwcf->ssl_certificate.len) { |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2204 |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2205 if (uwcf->ssl_certificate_key.len == 0) { |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2206 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2207 "no \"uwsgi_ssl_certificate_key\" is defined " |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2208 "for certificate \"%V\"", &uwcf->ssl_certificate); |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2209 return NGX_ERROR; |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2210 } |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2211 |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2212 if (ngx_ssl_certificate(cf, uwcf->upstream.ssl, &uwcf->ssl_certificate, |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2213 &uwcf->ssl_certificate_key, uwcf->ssl_passwords) |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2214 != NGX_OK) |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2215 { |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2216 return NGX_ERROR; |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2217 } |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2218 } |
20d966ad5e89
Upstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora <piotr@cloudflare.com>
parents:
5883
diff
changeset
|
2219 |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2220 if (SSL_CTX_set_cipher_list(uwcf->upstream.ssl->ctx, |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2221 (const char *) uwcf->ssl_ciphers.data) |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2222 == 0) |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2223 { |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2224 ngx_ssl_error(NGX_LOG_EMERG, cf->log, 0, |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2225 "SSL_CTX_set_cipher_list(\"%V\") failed", |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2226 &uwcf->ssl_ciphers); |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2227 return NGX_ERROR; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2228 } |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2229 |
5662
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
2230 if (uwcf->upstream.ssl_verify) { |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
2231 if (uwcf->ssl_trusted_certificate.len == 0) { |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
2232 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
2233 "no uwsgi_ssl_trusted_certificate for uwsgi_ssl_verify"); |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
2234 return NGX_ERROR; |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
2235 } |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
2236 |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
2237 if (ngx_ssl_trusted_certificate(cf, uwcf->upstream.ssl, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
2238 &uwcf->ssl_trusted_certificate, |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
2239 uwcf->ssl_verify_depth) |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
2240 != NGX_OK) |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
2241 { |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
2242 return NGX_ERROR; |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
2243 } |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
2244 |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
2245 if (ngx_ssl_crl(cf, uwcf->upstream.ssl, &uwcf->ssl_crl) != NGX_OK) { |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
2246 return NGX_ERROR; |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
2247 } |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
2248 } |
3cb79707516a
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5659
diff
changeset
|
2249 |
5457
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2250 return NGX_OK; |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2251 } |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2252 |
c82b2e020b9f
SSL support in the uwsgi module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5451
diff
changeset
|
2253 #endif |