Skip to content

Commit

Permalink
Inherit fastcgi configuration
Browse files Browse the repository at this point in the history
This patch makes all nested locations inherit fastcgi configuration,
so that e.g. the following configuration passes /somewhere/foo to fastcgi:

location / {
	location /somewhere {
		whatever;
	}
	fastcgi_pass somewhere;
}
  • Loading branch information
gnosek committed Oct 6, 2007
1 parent 995836e commit 55029f7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/http/modules/ngx_http_fastcgi_module.c
Expand Up @@ -1958,8 +1958,21 @@ ngx_http_fastcgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
peers:

if (conf->upstream.upstream == NULL) {
ngx_http_core_loc_conf_t *clcf;

conf->upstream.upstream = prev->upstream.upstream;
conf->upstream.schema = prev->upstream.schema;

clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
if (conf->upstream.upstream) {
clcf->handler = ngx_http_fastcgi_handler;
}
if (clcf->name.data && clcf->name.len) {
conf->upstream.location = clcf->name;
if (clcf->name.data[clcf->name.len - 1] == '/') {
clcf->auto_redirect = 1;
}
}
}

if (conf->params_source == NULL) {
Expand Down

0 comments on commit 55029f7

Please sign in to comment.