Custom Query (2297 matches)
Results (34 - 36 of 2297)
Ticket | Resolution | Summary | Owner | Reporter |
---|---|---|---|---|
#34 | fixed | Allow rewrites in case of proxy_pass backend is configured as variable | ||
Description |
As a follow up on the discussion on http://forum.nginx.org/read.php?2,215830 I would kindly ask to merge the patch provided by Maxim Dounin into Nginx # HG changeset patch # User Maxim Dounin <mdounin@mdounin.ru> # Date 1317281138 -14400 # Node ID d6a0787307868c06073d92bb39eb2f73acf19d7c # Parent 29d417d419d946dce33023c71cce0e586ef3547b Proxy: made proxy_pass with variables more consitent. If proxy_pass were used with variables and there were no URI component, nginx always used unparsed URI. This isn't consistent with "no variables" case, where e.g. rewrites are applied even if there are no URI component. Fix is to use same logic in both cases, i.e. only use unparsed URI if it's valid and request is main one. diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c --- a/src/http/modules/ngx_http_proxy_module.c +++ b/src/http/modules/ngx_http_proxy_module.c @@ -738,9 +738,6 @@ ngx_http_proxy_eval(ngx_http_request_t * url.uri.len++; url.uri.data = p - 1; } - - } else { - url.uri = r->unparsed_uri; } ctx->vars.key_start = u->schema; @@ -808,7 +805,7 @@ ngx_http_proxy_create_key(ngx_http_reque return NGX_ERROR; } - if (plcf->proxy_lengths) { + if (plcf->proxy_lengths && ctx->vars.uri.len) { *key = ctx->vars.uri; u->uri = ctx->vars.uri; @@ -918,7 +915,7 @@ ngx_http_proxy_create_request(ngx_http_r loc_len = 0; unparsed_uri = 0; - if (plcf->proxy_lengths) { + if (plcf->proxy_lengths && ctx->vars.uri.len) { uri_len = ctx->vars.uri.len; } else if (ctx->vars.uri.len == 0 && r->valid_unparsed_uri && r == r->main) @@ -1024,7 +1021,7 @@ ngx_http_proxy_create_request(ngx_http_r u->uri.data = b->last; - if (plcf->proxy_lengths) { + if (plcf->proxy_lengths && ctx->vars.uri.len) { b->last = ngx_copy(b->last, ctx->vars.uri.data, ctx->vars.uri.len); } else if (unparsed_uri) {
This makes Nginx's rewriting behavior consistent with a statically configured |
|||
#35 | invalid | nginx not strip #fragment for proxy_pass | ||
Description |
I known web browser dose not submit fragment string to server. But some robot dose not strip the #fragment in URL, and send it to server, it will cause a http 404. May be it's not a bug, it's robot bug. But in future, fragment will be more use. Example: # in xxx.conf location / { proxy_pass http://backend; # ... } # test curl http://example.org/something#fragment # solution rewrite (.+) $1; location / { proxy_pass http://backend; # ... } |
|||
#36 | wontfix | Feature Request - Support Filtering Requests by mimetype | ||
Description |
It would be really advantageous to filter requests like we do with location using mimetypes. As an example: mimetype image/png {
} Multiple mimetypes: mimetype image/* text/html {
} The main reason to do this is for setting expiry explicitly for different content types. For now, we rely on using location to specify by extension, but this can be problematic when using cgi, because sometimes the url doesn't contain the extension, and there is no way to separate out content types. There are, of course, other reasons to do this. Perhaps to deny certain file types from being sent, even when they don't contain a correct (or any) file extension. Obviously, since we would want this to work for fastcgi, etc, it would have to run *after* we receive the response from upstream. |