~groldster/ubuntu/maverick/nginx/merge-from-sid-0.7.67-2

« back to all changes in this revision

Viewing changes to src/http/modules/ngx_http_proxy_module.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Hahler
  • Date: 2010-03-03 23:50:36 UTC
  • mfrom: (1.1.16 upstream) (4.2.14 sid)
  • Revision ID: james.westby@ubuntu.com-20100303235036-jif3s2b0w3pnvokr
Tags: 0.7.65-1ubuntu1
* Merge from debian testing. (LP: #531655) Remaining changes:
  - Add a UFW profile set: 
    + debian/nginx.ufw.profile: Added.
    + debian/control: nginx: Suggests ufw.
    + debian/dirs: Add 'etc/ufw/applications.d'
    + debian/rules: Add install rule for the nginx UFW profile.
  - Install html files.
    - debian/dirs: Add 'var/www/nginx-default'.
    - debian/nginx.install: Add 'html/* var/www/nginx-default'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
530
530
    { ngx_string("Expect"), ngx_string("") },
531
531
    { ngx_string("If-Modified-Since"), ngx_string("") },
532
532
    { ngx_string("If-Unmodified-Since"), ngx_string("") },
533
 
    { ngx_string("If-Match-None"), ngx_string("") },
 
533
    { ngx_string("If-None-Match"), ngx_string("") },
534
534
    { ngx_string("If-Match"), ngx_string("") },
535
535
    { ngx_string("Range"), ngx_string("") },
536
536
    { ngx_string("If-Range"), ngx_string("") },
717
717
        return NGX_ERROR;
718
718
    }
719
719
 
720
 
    if (url.uri.len && url.uri.data[0] == '?') {
721
 
        p = ngx_pnalloc(r->pool, url.uri.len + 1);
722
 
        if (p == NULL) {
723
 
            return NGX_ERROR;
 
720
    if (url.uri.len) {
 
721
        if (url.uri.data[0] == '?') {
 
722
            p = ngx_pnalloc(r->pool, url.uri.len + 1);
 
723
            if (p == NULL) {
 
724
                return NGX_ERROR;
 
725
            }
 
726
 
 
727
            *p++ = '/';
 
728
            ngx_memcpy(p, url.uri.data, url.uri.len);
 
729
 
 
730
            url.uri.len++;
 
731
            url.uri.data = p - 1;
724
732
        }
725
733
 
726
 
        *p++ = '/';
727
 
        ngx_memcpy(p, url.uri.data, url.uri.len);
728
 
 
729
 
        url.uri.len++;
730
 
        url.uri.data = p - 1;
 
734
    } else {
 
735
        url.uri = r->unparsed_uri;
731
736
    }
732
737
 
733
738
    ctx->vars.key_start = u->schema;
1218
1223
 
1219
1224
        if (r->cache) {
1220
1225
            r->http_version = NGX_HTTP_VERSION_9;
1221
 
            u->headers_in.status_n = NGX_HTTP_OK;
1222
1226
            return NGX_OK;
1223
1227
        }
1224
1228
 
1234
1238
#endif
1235
1239
 
1236
1240
        r->http_version = NGX_HTTP_VERSION_9;
1237
 
        u->headers_in.status_n = NGX_HTTP_OK;
1238
1241
        u->state->status = NGX_HTTP_OK;
1239
1242
 
1240
1243
        return NGX_OK;
2585
2588
 
2586
2589
    clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
2587
2590
 
 
2591
    clcf->handler = ngx_http_proxy_handler;
 
2592
 
 
2593
    if (clcf->name.data[clcf->name.len - 1] == '/') {
 
2594
        clcf->auto_redirect = 1;
 
2595
    }
 
2596
 
2588
2597
    value = cf->args->elts;
2589
2598
 
2590
2599
    url = &value[1];
2613
2622
        }
2614
2623
#endif
2615
2624
 
2616
 
        clcf->handler = ngx_http_proxy_handler;
2617
 
 
2618
2625
        return NGX_CONF_OK;
2619
2626
    }
2620
2627
 
2661
2668
 
2662
2669
    ngx_http_proxy_set_vars(&u, &plcf->vars);
2663
2670
 
2664
 
    clcf->handler = ngx_http_proxy_handler;
2665
 
 
2666
2671
    plcf->location = clcf->name;
2667
2672
 
2668
2673
    if (clcf->named
2686
2691
 
2687
2692
    plcf->url = *url;
2688
2693
 
2689
 
    if (clcf->name.data[clcf->name.len - 1] == '/') {
2690
 
        clcf->auto_redirect = 1;
2691
 
    }
2692
 
 
2693
2694
    return NGX_CONF_OK;
2694
2695
}
2695
2696