* conf->upstream.next_upstream = 0;
* conf->upstream.temp_path = NULL;
* conf->upstream.hide_headers_hash = { NULL, 0 };
- * conf->upstream.schema = { 0, NULL };
* conf->upstream.uri = { 0, NULL };
* conf->upstream.location = NULL;
* conf->upstream.store_lengths = NULL;
if (conf->upstream.upstream == NULL) {
conf->upstream.upstream = prev->upstream.upstream;
- conf->upstream.schema = prev->upstream.schema;
}
if (conf->fastcgi_lengths == NULL) {
ngx_http_core_loc_conf_t *clcf;
ngx_http_script_compile_t sc;
- if (flcf->upstream.schema.len) {
+ if (flcf->upstream.upstream || flcf->fastcgi_lengths) {
return "is duplicate";
}
clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
clcf->handler = ngx_http_fastcgi_handler;
- flcf->upstream.schema.len = sizeof("fastcgi://") - 1;
- flcf->upstream.schema.data = (u_char *) "fastcgi://";
-
value = cf->args->elts;
url = &value[1];
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
- u->schema = mlcf->upstream.schema;
+ u->schema.len = sizeof("memcached://") - 1;
+ u->schema.data = (u_char *) "memcached://";
u->peer.log = r->connection->log;
u->peer.log_error = NGX_ERROR_ERR;
* conf->upstream.bufs.num = 0;
* conf->upstream.next_upstream = 0;
* conf->upstream.temp_path = NULL;
- * conf->upstream.schema = { 0, NULL };
* conf->upstream.uri = { 0, NULL };
* conf->upstream.location = NULL;
*/
if (conf->upstream.upstream == NULL) {
conf->upstream.upstream = prev->upstream.upstream;
- conf->upstream.schema = prev->upstream.schema;
}
if (conf->index == NGX_CONF_UNSET) {
ngx_url_t u;
ngx_http_core_loc_conf_t *clcf;
- if (lcf->upstream.schema.len) {
+ if (lcf->upstream.upstream) {
return "is duplicate";
}
return NGX_CONF_ERROR;
}
- lcf->upstream.schema.len = sizeof("memcached://") - 1;
- lcf->upstream.schema.data = (u_char *) "memcached://";
-
clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
clcf->handler = ngx_http_memcached_handler;
typedef struct {
+ ngx_str_t schema;
ngx_str_t host_header;
ngx_str_t port;
ngx_str_t uri;
if (plcf->proxy_lengths == 0) {
ctx->vars = plcf->vars;
- u->schema = plcf->upstream.schema;
+ u->schema = plcf->vars.schema;
#if (NGX_HTTP_SSL)
u->ssl = (plcf->upstream.ssl != NULL);
#endif
* conf->upstream.next_upstream = 0;
* conf->upstream.temp_path = NULL;
* conf->upstream.hide_headers_hash = { NULL, 0 };
- * conf->upstream.schema = { 0, NULL };
* conf->upstream.uri = { 0, NULL };
* conf->upstream.location = NULL;
* conf->upstream.store_lengths = NULL;
if (conf->upstream.upstream == NULL) {
conf->upstream.upstream = prev->upstream.upstream;
-
conf->vars = prev->vars;
- conf->upstream.schema = prev->upstream.schema;
}
ngx_http_core_loc_conf_t *clcf;
ngx_http_script_compile_t sc;
- if (plcf->upstream.schema.len) {
+ if (plcf->upstream.upstream || plcf->proxy_lengths) {
return "is duplicate";
}
return NGX_CONF_ERROR;
}
- plcf->upstream.schema.len = add;
- plcf->upstream.schema.data = url->data;
+ plcf->vars.schema.len = add;
+ plcf->vars.schema.data = url->data;
plcf->location = clcf->name;
clcf->handler = ngx_http_proxy_handler;
ngx_array_t *hide_headers;
ngx_array_t *pass_headers;
- ngx_str_t schema;
-
ngx_array_t *store_lengths;
ngx_array_t *store_values;