Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progress doesn't work if X-Progress-ID is set with more headers module #10

Open
lexer opened this issue Mar 10, 2011 · 8 comments
Open

Comments

@lexer
Copy link

lexer commented Mar 10, 2011

In our application we need X-Progress-ID to be parsed from $request_url
location /upload {

if ($request_uri ~* ^/upload/(.*)$) {
set $progress_id $1;
more_set_headers "X-Progress-ID:$progress_id";
}

proxy_pass http://127.0.0.1;
proxy_redirect default;

track_uploads proxied 30s;
}

However progress doesn't work in this case.

@masterzen
Copy link
Owner

Can you attach (or send me privately by e-mail) the full debug log (you'll need to compile nginx with --with-debug)?
I think "more_set_headers" phase happens after the upload is registered in the upload progress module, which I'm afraid can't be fixed easily, but I'd like to check first with the log.

@lexer
Copy link
Author

lexer commented Mar 10, 2011

I've mailed it to you.

@lexer
Copy link
Author

lexer commented Mar 10, 2011

I also checked debug log and as you suggest get_tracking_id is called earlier then headers are set.

How can I fix it?

1 similar comment
@lexer
Copy link
Author

lexer commented Mar 10, 2011

I also checked debug log and as you suggest get_tracking_id is called earlier then headers are set.

How can I fix it?

@masterzen
Copy link
Owner

Hmm, reading more headers documentation, it looks like "more_set_headers" sets output headers (the one that will be returned to the client).
Can you try with "more_set_input_header" instead?

@lexer
Copy link
Author

lexer commented Mar 11, 2011

Yep, that solve half of problem. But first call get_tracking_id is performed earlier then setting of headers.

In our application we need to proxy traffic to Amazon that reject requests with querystring.

So currently we have solve problem in following way. We receive querystring param. Set header using querystring value and then remove querystring with rewriting.

location /upload {      

    if ($request_uri ~* "^/upload\?X-Progress-ID=(.*)$") {
        set $progress_id $1;
        more_set_input_headers "X-Progress-ID: $progress_id";       
    }

    set $args "";
    rewrite ^(.*)$ / break; 

    proxy_pass http://myamazonbucket.s3.amazonaws.com/;             
    #proxy_redirect default;        
    track_uploads proxied 30s;
}

@masterzen
Copy link
Owner

Do you mean the problem is solved by the rewrite break?

@lexer
Copy link
Author

lexer commented Mar 11, 2011

Rewrite required to remove "/upload". set $args "" removes "X-Progress-ID" from querystring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants