-
Notifications
You must be signed in to change notification settings - Fork 80
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
small_light didn't works well with proxy_pass directive #73
Comments
You cannot use the directives such as |
@cubicdaiya divide them into different virtual servers? I still didn't get it. |
Show your configuration example for reproducing. |
@cubicdaiya there's some NDA on my configuration, can we talk using private communication (eg. email). |
No. |
I tried with the configuration below. But It seems to work fine in my environment. server {
small_light on;
small_light_getparam_mode on;
small_light_pattern_define hoge dw=200,dh=200;
location / {
proxy_pass http://example.com;
}
} If you cannot provide the real configuration, please provide the minimal example configuraiton for reproducing. |
@cubicdaiya here is the configuration, i remove FQDN from external resource.
If I use Update: |
Why don't you decrease quality? ( Maybe 80 is too high for WebP.) |
@cubicdaiya my bad, the value on pattern_define should be |
The cause is the value of q is too large? In my environment, the converted-webp-image size is larger than original-image when q is large. (e.g. q=80) Maybe converted-webp-image is smaller than original if q is more low or eliminating q in parameters. |
As your request, I remove parameter Original Upstream:
Result, I got Proxied images:
On chrome, I got Tried add |
Your WebP image looks gzip-compressed. As a image such as WebP and JPEG is already compressed, they should not be compressed by gzip. ( In most case, image size will be expanded. ) |
Ok, I was set webp are not compressed by gzip. Upstream Images: 0_0_1000_666_ecf9dfd112be52fd0e81f4522f5d8abe60905508.jpg
Proxied Images: 0_0_1000_666_ecf9dfd112be52fd0e81f4522f5d8abe60905508.jpg
Why proxied image file larger than upstream image file? Still using FYI, this is my system environment.
uname -ar
ImageMagick
|
Why don't you try to convert your image by
|
@cubicdaiya Done, convert it to test the size is lower than original images?
|
In my envinronment,
|
This phenomenon is not reproduced at all. So I have no idea. Is your image quality just high? |
@cubicdaiya I can give you a sandbox and replicate my existing environment. So you can login and reproduce there. I thought the configuration above is same with existing environment, the difference is the FQDN upstream. How about that? FYI,
You can access it through http://103.52.2.19/0_0_1000_666_ecf9dfd112be52fd0e81f4522f5d8abe60905508_q10.webp. Dunno how to reproduce and start from where :D |
I'm sorry, but I'm not going so far as to investigate this problem. |
@cubicdaiya it's okey bro :) I just give feedback to your hobby then. 👍 |
Hello!
Got curious, when I deploy
small_light
module combine withproxy_pass
directive, my goal is to optimize images from external resource. My nginx + small_light + proxy_pass configuration looks like :I tried to check external resource file size using cURL:
external resource
Proxied using nginx + small_light + proxy_pass
Nginx + small_light
The images self-hosted on it's server, not proxied to upstream.
My question is, the size of file didn't optimized when proxied to upstream, see
content-length
's overhead on external resource (592651
bytes) with nginx + small_light + proxy_pass (595062
bytes). We got ~3KBytes overhead ifsmall_light
active on proxy_pass directive.Then, we got only
33698
bytes on non-proxied images.Is it normal?
Update:
Bugs appeared when using pattern define, but when I directly invoke using
of=webp&q=80
, it's works.The text was updated successfully, but these errors were encountered: