Welcome! Log In Create A New Profile

Advanced

gunzip response

July 08, 2022 02:11PM
Trying to gunzip upstream server response, to do a substitution.
here is part of my config:
```
location ~ /path/to/(?<mark>[A-Z0-9]+) {
gunzip on;
proxy_ssl_server_name on;
#proxy_set_header accept-encoding ",";
proxy_set_header Accept-Encoding "";
proxy_pass https://$http_host;
set $code 'Hello $mark';
sub_filter '<div class="secret-class">' '<div class="secret-class">$code';
sub_filter_last_modified on;
sub_filter_once on;
keepalive_timeout 0;
}
```
but with turned debugging on I don't see nginx even stepping to the gunzip filter

here is the actual server response headers:
```
2022/07/08 17:11:23 [debug] 905#905: *1 HTTP/1.1 200 OK^M
Server: nginx/1.18.0 (Ubuntu)^M
Date: Fri, 08 Jul 2022 17:11:23 GMT^M
Content-Type: text/html;charset=UTF-8^M
Transfer-Encoding: chunked^M
Connection: close^M
x-amz-rid: YWZ57AJXZBYB0FG289ZP^M
Content-Encoding: gzip^M
Accept-CH: ect,rtt,downlink,device-memory,sec-ch-device-memory,viewport-width,sec-ch-viewport-width,dpr,sec-ch-dpr^M
Accept-CH-Lifetime: 86400^M
Cache-Control: no-cache, no-transform^M
P3P: policyref="https://www.amazon.com/w3c/p3p.xml",CP="CAO DSP LAW CUR ADM IVAo IVDo CONo OTPo OUR DELi PUBi OTRi BUS PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA HEA PRE LOC GOV OTC "^M
X-XSS-Protection: 1;^M
X-Content-Type-Options: nosniff^M
content-security-policy-report-only: default-src 'self' blob: https: data: mediastream: 'unsafe-eval' 'unsafe-inline';report-uri https://metrics.media-amazon.com/^M
Strict-Transport-Security: max-age=47474747; includeSubDomains; preload^M
Vary: Content-Type,Accept-Encoding,X-Amzn-CDN-Cache,X-Amzn-AX-Treatment,User-Agent^M
X-Frame-Options: SAMEORIGIN^M
Permissions-Policy: interest-cohort=()^M
X-Cache: Miss from cloudfront^M
Via: 1.1 b8d025b20dd973defd450601f0b4ae40.cloudfront.net (CloudFront)^M
X-Amz-Cf-Pop: YTO50-C1^M
X-Amz-Cf-Id: SpR4NSd4oee_n1EGMR2qsYjOJUajz5JCCmne1VQAPbtIQfIr5TOQVQ==^M
```
what I'm doing wrong?
Subject Author Posted

gunzip response

theromis1 July 08, 2022 02:11PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 290
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready