alibaba / tengine

A distribution of Nginx with some advanced features
https://tengine.taobao.org
BSD 2-Clause "Simplified" License
12.76k stars 2.52k forks source link

Pls. refer to doc [Ngx_http_trim_filter](https://tengine.taobao.org/document/http_trim_filter.html) specifically. #1900

Open pashunchik opened 10 months ago

pashunchik commented 10 months ago

it is not work after upgrade Tengine. are have old version 3.0

http { trim on;

trim_js on;

trim_css on;

nginx -V Tengine version: Tengine/3.1.0 nginx version: nginx/1.24.0 built by gcc 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04) built with OpenSSL 1.1.1q 5 Jul 2022 TLS SNI support enabled configure arguments: --conf-path=/etc/nginx/nginx.conf --sbin-path=/usr/sbin/nginx --error-log-path=/var/log/nginx/error.log --with-threads --http-log-path=/var/log/nginx/ --pid-path=/var/run/nginx.pid --http-log-path=/var/log/nginx/access.log --user=www-data --group=www-data --with-cc-opt=-Wno-error --with-http_realip_module --with-stream_realip_module --with-http_geoip_module --with-stream_geoip_module --add-module=modules/ngx_http_reqstat_module --add-module=modules/ngx_http_trim_filter_module --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --add-module=src/http/modules/nginx-module-vts --add-module=src/http/modules/ngx_http_geoip2_module --with-http_perl_module --with-openssl=../openssl-1.1.1q/ --with-openssl-opt=enable-tls1_3 --add-module=src/http/modules/ngx_http_lower_upper_case

          Pls. refer to doc  [Ngx_http_trim_filter](https://tengine.taobao.org/document/http_trim_filter.html) specifically.

E.g., image

Tengine conf: image

index.html of upstream with comments: image

The comments was removed from the response of upstream by the tengine: image

Originally posted by @lianglli in https://github.com/alibaba/tengine/issues/1896#issuecomment-1829999721

lianglli commented 10 months ago

This function is worked for both tengine 3.0.0 and 3.1.0.

Tengine Conf: image

Upstream Index.html Add comments to the html and css: image image

The above comments has been removed from the response by tengine: $ curl -i https://tengine.daily.taobao.net HTTP/2 200 date: Mon, 04 Dec 2023 03:41:51 GMT content-type: text/html vary: Accept-Encoding server: Tengine Ingress/3.0.1 vary: Accept-Encoding via: tengine-site.011159138070.nt12[web,200]

<!DOCTYPE html> Githubissues.

  • Githubissues is a development platform for aggregating issues.