-
Notifications
You must be signed in to change notification settings - Fork 2k
How to handle gziped capture? #12
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
Comments
Remove Accept-Encoding header from the request can prevent server responsing with gzip compressed content. If this can't be done, you can also decompress gzip'd content in Lua by using birmworks' lua-zlib module or similar ones (https://github.com/brimworks/lua-zlib). |
If you're using the ngx_proxy module for your subrequests, try using the following directive to prevent forwarding your original request's headers:
See http://wiki.nginx.org/NginxHttpProxyModule#proxy_pass_request_headers for more details. Alternatively, you can explicitly remove the Accep-Encoding header in your subrequest location like this:
You need the ngx_headers_more module though. See http://wiki.nginx.org/NginxHttpHeadersMoreModule#more_clear_input_headers for more details :) |
Thank-you. All three options work. OPTION ONE Placed: OPTION TWO Placed: OPTION THREE Downloaded https://github.com/brimworks/lua-zlib : added following to conf: I like having all three as options (may need gz some time and good to be able to modify the headers). I also like the work that both of you are doing; very cool. |
zzlib may help |
This may be more of a question than an issue. I want to feed the body of one capture into another ex:
local res2 = ngx.location.capture("/cap2?"..res1.body)
However res1.body was gziped by the origin server. Any idea how I can prevent the gzip of the body (a special Accept-Encoding header maybe) or unzip it using something like the gzio library on luaforge (http://luaforge.net/projects/gzio/)?
The text was updated successfully, but these errors were encountered: