annotate src/http/modules/ngx_http_uwsgi_module.c @ 7320:696df3ac27ac

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