-
Notifications
You must be signed in to change notification settings - Fork 232
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
commit 27401eb break upstream proxy support with gzip #49
Comments
I cannot reproduce your issue with the latest build: it works for me. I used the same exact setup as you did with locahost upstreaming proxy on |
@sergeyfrolov it's broken with gzip config in upstream
|
I dug deeper into this issue, but had no success discovering the cause. I suspect it gets compressed twice or @bash99 I will note, however, that the only reason for you to explicitly enable |
It appears to me that |
I'm not entirely sure, because even if it was a bug, I'm not sure how gzip could change the Content-Length header value after the headers are written. Notice how we just omit that header, here, because of that issue: https://github.com/mholt/caddy/blob/d47b041923daf055bb97c94f29a7f5bf14a4cb2a/caddyhttp/gzip/gzip.go#L114-L119 |
But does it (re-)compress, when the data was compressed/header was written already? |
If it's already compressed, then you're right, it shouldn't re-compress, that might be a bug. It'd be the first I've/we've heard of it though :) (Seems a bit unusual.) |
@sergeyfrolov Yes, I can live without the gzip config line. One more thing I can provide is, if I use firefox/chrome to access upstream proxy directly (with gzip config line), I've no problem at all. |
1. Is bug reproducible with latest
forwardproxy
build?Yes
and I've try build myself, a035ebe works, and 27401eb failed.
2. What are you trying to do?
forward with upstream caddy proxy
3. What is your entire Caddyfile?
upstream setting
local proxy setting
4. How is your client configured?
5. How did you run Caddy? (give the full command and describe the execution environment). If multiple servers are used (for example with
upstream
), describe those as well.just start caddy from command line.
6. Please paste any relevant HTTP request(s) here.
7. What did you expect to see?
download the aaa.txt and print it on console
8. What did you see instead (give full error messages and/or log)?
use strace on both side, I've found upstream caddy actually write the response
and it seems local caddy has also received it
but caddy don't think the request is finished.
9. How can someone who is starting from scratch reproduce the bug as minimally as possible?
use above config.
The text was updated successfully, but these errors were encountered: