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