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

nbnkbykc  于 5个月前  发布在  其他
关注(0)|答案(7)|浏览(44)

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.,

Tengine conf:

index.html of upstream with comments:

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

Originally posted by @lianglli in #1896 (comment)

pkmbmrz7

pkmbmrz71#

This function is worked for both tengine 3.0.0 and 3.1.0.

Tengine Conf:

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

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]

function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-SNH2MHXGCW');</script><meta charset="utf-8"><meta name="renderer" content="webkit"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="author" content="Designed by 阿里云UED AX"><title>The Tengine Web Server</title><meta property="og:type" content="website"><meta property="og:title" content="The Tengine Web Server"><meta property="og:url" content="http://tengine.taobao.org/index.html"><meta property="og:site_name" content="The Tengine Web Server"><meta property="og:locale" content="default"><meta name="twitter:card" content="summary"><meta name="twitter:title" content="The Tengine Web Server"><link rel="alternate" href="/atom.xml" title="The Tengine Web Server" type="application/atom+xml"><link rel="stylesheet" href="/css/base.min.css"><link rel="stylesheet" href="/css/main.css"></head><body class="page-is-loading"><div class="container-fluid"><div class="row global-header"><div class="container"><div class="row"><div class="col-lg-12"><div class="row"><div class="navbar-header col-lg-2 col-xs-12"><button aria-controls="nav-menu" aria-expanded="false" class="navbar-toggle collapsed" data-target="#nav-menu" data-toggle="collapse" type="button"><span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span></button><h1 class="text-muted site-logo navbar-brand"><a href="/" id="logo" class="text-hide">The Tengine Web Server</a></h1></div><div class="col-lg-10 col-xs-12"><nav id="nav-menu" class="navbar-collapse collapse" aria-expanded="false"><ul class="nav navbar-nav navbar-right"><li role="presentation"><a class="menu-item" href="/download.html">Download</a></li><li role="presentation"><a class="menu-item" href="/source.html">Source</a></li><li role="presentation"><a class="menu-item" href="/documentation.html">Document</a></li><li role="presentation"><a class="menu-item" href="/faq.html">FAQ</a></li><li role="presentation"><a class="menu-item" href="/contact.html">Contact</a></li><li role="presentation"><a class="menu-item" href="http://tengine.taobao.org/book/" target="_blank">Guide</a></li><li role="presentation"><a class="menu-item" href="https://www.aliyun.com/" target="_blank">Buy Server</a></li><li role="presentation" class="col-hide-xs"><select class="lang-switch pull-right"></select></li><li role="presentation" class="hide"><a href="#"><i class="fa fa-bars" aria-hidden="true"></i></a></li></ul></nav></div></div></div></div></div></div></div><div class="container-fluid" id="main"><section class="row"><div class="fluid-container homepage-intro container-zh-cn hide"><div class="row"><div class="container"><div class="lead-label"><h2><i class="fa fa-user" aria-hidden="true"></i><span>简介</span></h2><div class="bg-border-container"><div class="bg-border"></div></div></div><p class="lead">Tengine是由淘宝网发起的Web服务器项目。它在<a href="http://nginx.org/" target="_blank" rel="external">Nginx</a> 的基础上,针对大访问量网站的需求,添加了很多高级功能和特性。Tengine的性能和稳定性已经在大型的网站如<a href="http://www.taobao.com/" target="_blank" rel="external">淘宝网</a> ,<a href="http://www.tmall.com" target="_blank" rel="external">天猫商城</a> 等得到了很好的检验。它的最终目标是打造一个高效、稳定、安全、易用的Web平台。</p><p class="lead">从2011年12月开始,Tengine成为一个开源项目,Tengine团队在积极地开发和维护着它。Tengine团队的核心成员来自于<a href="http://www.taobao.com/" target="_blank" rel="external">淘宝</a> 、<a href="http://www.sogou.com/" target="_blank" rel="external">搜狗</a> 等互联网企业。Tengine是社区合作的成果,我们欢迎大家<a href="source_cn.html">参与其中</a> ,贡献自己的力量。</p><p></p><p><a class="btn btn-lg btn-success download-button" href="download/tengine-2.3.3.tar.gz" role="button">Download</a></p></div></div><div class="row"><div id="particles-js-cn" class="col-lg-12"></div></div></div><div class="fluid-container homepage-intro container-en-us"><div class="container"><div class="lead-label"><h2><i class="fa fa-user" aria-hidden="true"></i><span>Introduction</span></h2><div class="bg-border-container"><div class="bg-border"></div></div></div><p class="lead">Tengine is a web server originated by <a href="http://en.wikipedia.org/wiki/Taobao" target="_blank" rel="external">Taobao</a>, the largest e-commerce website in Asia. It is based on the <a href="http://nginx.org" target="_blank" rel="external">Nginx</a> HTTP server and has many advanced features. Tengine has proven to be very stable and efficient on some of the top 100 websites in the world, including <a href="http://www.taobao.com" target="_blank" rel="external">taobao.com</a> and <a href="http://www.tmall.com/" target="_blank" rel="external">tmall.com</a>.</p><p class="lead">Tengine has been an open source project since December 2011. It is being actively developed by the Tengine team, whose core members are from <a href="http://en.wikipedia.org/wiki/Taobao" target="_blank" rel="external">Taobao</a>, <a href="http://en.wikipedia.org/wiki/Sogou" target="_blank" rel="external">Sogou</a> and other Internet companies. Tengine is a community effort and everyone is encouraged to <a href="source.html">get involved</a>.</p><p><a class="btn btn-lg btn-success download-button" href="download/tengine-2.3.3.tar.gz" role="button">Download</a></p></div><div id="particles-js-en"></div></div><div class="fluid-container homepage-item-list container-zh-cn hide"><div class="row"><div class="col-lg-12 info-item info-feature"><div class="container"><div class="lead-label"><h2><i class="fa fa-bullseye" aria-hidden="true"></i><span>特性</span></h2><div class="bg-border-container"><div class="bg-border"></div></div></div><ul><li>继承Nginx-1.17.3的所有特性,兼容Nginx的配置;</li><li>支持HTTP的<a href="document_cn/proxy_connect_cn.html">CONNECT</a> 方法,可用于正向代理场景;</li><li>增强相关运维监控能力,比如 <a href="document_cn/ngx_log_pipe_cn.html">异步打印日志及回滚</a>, <a href="document_cn/core_cn.html">本地DNS缓存</a>, <a href="document_cn/ngx_debug_pool_cn.html">内存监控</a>, 等;</li><li><a href="document_cn/http_core_cn.html">流式上传</a> 到HTTP后端服务器或FastCGI服务器,大量减少机器的I/O压力;</li><li><a href="document_cn/ngx_http_ssl_asynchronous_mode_cn.html">支持异步OpenSSL</a> ,可使用硬件如: <a href="document_cn/tengine_qat_ssl_cn.html">QAT</a> 进行HTTPS的加速与卸载;</li><li>更加强大的负载均衡能力,包括<a href="document_cn/http_upstream_consistent_hash_cn.html">一致性hash模块</a> 、<a href="document_cn/http_upstream_session_sticky_cn.html">会话保持模块</a> ,<a href="document_cn/http_upstream_check_cn.html">还可以对后端的服务器进行主动健康检查</a> ,根据服务器状态自动上线下线,以及<a href="document_cn/http_upstream_dynamic_cn.html">动态解析upstream中出现的域名</a>;</li><li>支持设置proxy、memcached、fastcgi、scgi、uwsgi<a href="document_cn/ngx_limit_upstream_tries_cn.html">在后端失败时的重试次数</a>;</li><li><a href="http://wiki.nginx.org/HttpLuaModule" target="_blank" rel="external">动态脚本语言Lua</a> 支持。扩展功能非常高效简单;</li><li><a href="document_cn/stream_sni_cn.html">Stream模块支持server_name指令</a>;</li></ul></div></div><div class="col-lg-12 info-item info-feature2"><div class="container"><ul><li>支持按指定关键字(域名,url等)<a href="document_cn/http_reqstat_cn.html">收集Tengine运行状态</a> ;</li><li><a href="document_cn/http_concat_cn.html">组合多个CSS、JavaScript文件的访问请求变成一个请求</a> ;</li><li><a href="document_cn/http_trim_filter_cn.html">自动去除空白字符和注释</a> 从而减小页面的体积;</li><li>自动根据CPU数目设置进程个数和绑定CPU亲缘性;</li><li><a href="document_cn/http_sysguard_cn.html">监控系统的负载和资源占用从而对系统进行保护</a> ;</li><li><a href="document_cn/http_footer_filter_cn.html">显示对运维人员更友好的出错信息,便于定位出错机器</a>;</li><li><a href="document_cn/http_limit_req_cn.html">更强大的防攻击(访问速度限制)模块</a> ;</li><li><a href="document_cn/commandline_cn.html">更方便的命令行参数,如列出编译的模块列表、支持的指令等</a> ;</li><li>可以根据访问文件类型设置过期时间;</li><li>支持将error_page设置为default;</li><li>More</li></ul></div></div><div class="col-lg-12 info-item info-recent"><div class="container"><div class="lead-label"><h2><i class="fa fa-lightbulb-o" aria-hidden="true"></i><span>动态</span></h2><div class="bg-border-container"><div class="bg-border"></div></div></div><ul><li>[03/25/2021] <a href="download/tengine-2.3.3.tar.gz">Tengine-2.3.3</a> 开发版正式发布 (<a href="changelog_cn.html#2_3_3">changelog</a> )</li><li>[08/20/2019] <a href="download/tengine-2.3.2.tar.gz">Tengine-2.3.2</a> 开发版正式发布 (<a href="changelog_cn.html#2_3_2">changelog</a> )</li><li>[06/18/2019] <a href="download/tengine-2.3.1.tar.gz">Tengine-2.3.1</a> 开发版正式发布 (<a href="changelog_cn.html#2_3_1">changelog</a> )</li><li>[03/25/2019] <a href="download/tengine-2.3.0.tar.gz">Tengine-2.3.0</a> 开发版正式发布 (<a href="changelog_cn.html#2_3_0">changelog</a> )</li><li>[11/11/2018] <a href="download/tengine-2.2.3.tar.gz">Tengine-2.2.3</a> 开发版正式发布 (<a href="changelog_cn.html#2_2_3">changelog</a> )</li><li>[01/25/2018] <a href="download/tengine-2.2.2.tar.gz">Tengine-2.2.2</a> 开发版正式发布 (<a href="changelog_cn.html#2_2_2">changelog</a> )</li><li>[09/27/2017] <a href="download/tengine-2.2.1.tar.gz">Tengine-2.2.1</a> 开发版正式发布 (<a href="changelog_cn.html#2_2_1">changelog</a> )</li><li>[2016-12-02] <a href="download/tengine-2.2.0.tar.gz">Tengine-2.2.0</a> 开发版正式发布 (<a href="changelog_cn.html#2_2_0">changelog</a> )</li><li>[2015-12-31] <a href="download/tengine-2.1.2.tar.gz">Tengine-2.1.2</a> 稳定版正式发布 (<a href="changelog_cn.html#2_1_2">changelog</a> )</li><li>[2015-08-12] <a href="download/tengine-2.1.1.tar.gz">Tengine-2.1.1</a> 稳定版正式发布 (<a href="changelog_cn.html#2_1_1">changelog</a> )</li><li>[2014-12-19] <a href="download/tengine-2.1.0.tar.gz">Tengine-2.1.0</a> 开发版正式发布 (<a href="changelog_cn.html#2_1_0">changelog</a> )</li><li>[2014-05-30] <a href="download/tengine-2.0.3.tar.gz">Tengine-2.0.3</a> 开发版正式发布(<a href="changelog_cn.html#2_0_3">changelog</a> )</li><li>[2014-03-28] <a href="download/tengine-2.0.2.tar.gz">Tengine-2.0.2</a> 开发版正式发布(<a href="changelog_cn.html#2_0_2">changelog</a> )</li><li>[2014-03-06] <a href="download/tengine-2.0.1.tar.gz">Tengine-2.0.1</a> 开发版正式发布(<a href="changelog_cn.html#2_0_1">changelog</a> )</li><li>[2014-01-08] <a href="download/tengine-2.0.0.tar.gz">Tengine-2.0.0</a> 开发版正式发布(<a href="changelog_cn.html#2_0_0">changelog</a> )</li></ul></div></div><div class="col-lg-12 info-item info-recent2"><div class="container"><ul><li>[2013-11-22] <a href="download/tengine-1.5.2.tar.gz">Tengine-1.5.2</a> 稳定版正式发布(<a href="changelog_cn.html#1_5_2">changelog</a> )</li><li>[2013-08-29] <a href="download/tengine-1.5.1.tar.gz">Tengine-1.5.1</a> 稳定版正式发布(<a href="changelog_cn.html#1_5_1">changelog</a> )</li><li>[2013-08-04] 我们受邀在台湾<a href="http://coscup.org/2013/zh-cn/program/#day2_am" target="_blank" rel="external">开源人年会</a> 上做了<a href="download/tengine@alibaba.pdf">《Nginx深度开发与定制》</a> 的技术分享</li><li>[2013-07-31] <a href="download/tengine-1.5.0.tar.gz">Tengine-1.5.0</a> 稳定版正式发布(<a href="changelog_cn.html#1_5_0">changelog</a> )</li><li>[2013-05-14] <a href="download/tengine-1.4.6.tar.gz">Tengine-1.4.6</a> 开发版正式发布(<a href="changelog_cn.html#1_4_6">changelog</a> )</li><li>[2013-05-01] <a href="download/tengine-1.4.5.tar.gz">Tengine-1.4.5</a> 开发版正式发布(<a href="changelog_cn.html#1_4_5">changelog</a> )</li><li>[2013-03-21] <a href="download/tengine-1.4.4.tar.gz">Tengine-1.4.4</a> 开发版正式发布(<a href="changelog_cn.html#1_4_4">changelog</a> )</li><li>[2013-01-21] <a href="download/tengine-1.4.3.tar.gz">Tengine-1.4.3</a> 开发版正式发布(<a href="changelog_cn.html#1_4_3">changelog</a> )</li><li>[2012-11-22] <a href="download/tengine-1.4.2.tar.gz">Tengine-1.4.2</a> 开发版正式发布(<a href="changelog_cn.html#1_4_2">changelog</a> )</li><li>[2012-10-10] <a href="download/tengine-1.4.1.tar.gz">Tengine-1.4.1</a> 开发版正式发布(<a href="changelog_cn.html#1_4_1">changelog</a> )</li><li>[2012-09-05] <a href="download/tengine-1.4.0.tar.gz">Tengine-1.4.0</a> 开发版正式发布(<a href="changelog_cn.html#1_4_0">changelog</a> )</li><li>[2012-07-10] <a href="nginx_docs/cn/">Nginx文档中文翻译项目</a> 开始</li><li>[2012-06-28] 我们翻译的<a href="http://nginx.org/cn/" target="_blank" rel="external">Nginx中文文档</a> 正式被Nginx官方接受</li><li>[2012-06-09] 我们在华东运维技术大会做了<a href="download/taobao_nginx_2012_06.pdf">《淘宝网Nginx应用、定制与开发实战》</a> 的技术分享</li><li>[2012-05-25] <a href="download/tengine-1.3.0.tar.gz">Tengine-1.3.0</a> 稳定版正式发布(<a href="changelog_cn.html#1_3_0">changelog</a> )</li><li>[2012-05-09] <a href="download/tengine-1.2.5.tar.gz">Tengine-1.2.5</a> 稳定版正式发布(<a href="changelog_cn.html#1_2_5">changelog</a> )</li><li>[2012-03-30] <a href="download/tengine-1.2.4.tar.gz">Tengine-1.2.4</a> 稳定版正式发布(<a href="changelog_cn.html#1_2_4">changelog</a> )</li><li>[2012-03-08] Tengine开发团队开始编写开放书籍<a href="book/index.html">《Nginx开发从入门到精通》</a></li><li>[2012-02-27] <a href="download/tengine-1.2.3.tar.gz">Tengine-1.2.3</a> 稳定版正式发布(<a href="changelog_cn.html#1_2_3">changelog</a> )</li><li>[2012-01-11] <a href="download/tengine-1.2.2.tar.gz">Tengine-1.2.2</a> 稳定版正式发布(<a href="changelog_cn.html#1_2_2">changelog</a> )</li><li>[2011-12-07] Tengine开发团队在Velocity大会上介绍了<a href="http://velocity.oreilly.com.cn/2011/index.php?func=session&amp;name=%E6%89%93%E9%80%A0%E5%AE%89%E5%85%A8%E3%80%81%E6%98%93%E8%BF%90%E7%BB%B4%E7%9A%84%E9%AB%98%E6%80%A7%E8%83%BDWeb%E5%B9%B3%E5%8F%B0%EF%BC%9A%E6%B7%98%E5%AE%9D%E7%BD%91Nginx%E5%AE%9A%E5%88%B6%E5%BC%80%E5%8F%91%E5%AE%9E%E6%88%98" target="_blank" rel="external">《淘宝网Nginx定制实战》</a> 的一些经验</li><li>[2011-12-06] <a href="download/tengine-1.2.1.tar.gz">Tengine-1.2.1</a> 版本正式发布(<a href="changelog_cn.html#1_2_1">changelog</a> )</li><li>[2011-12-02] <a href="opensource_cn.html">Tengine宣布开源</a></li></ul></div></div></div></div><div class="fluid-container homepage-item-list container-en-us"><div class="row"><div class="col-lg-12 info-item info-feature"><div class="container"><div class="lead-label"><h2><i class="fa fa-bullseye" aria-hidden="true"></i><span>Features</span></h2><div class="bg-border-container"><div class="bg-border"></div></div></div><ul><li>All features of Nginx-1.17.3 are inherited, i.e., it is compatible with Nginx.</li><li>Support the <a href="document/proxy_connect.html">CONNECT</a> HTTP method for forward proxy.</li><li>Enhanced operations monitoring, such as <a href="document/ngx_log_pipe.html">asynchronous log & rollback</a>, <a href="document/core.html">DNS caching</a>, <a href="document/ngx_debug_pool.html">memory usage</a>, etc.</li><li>Sends <a href="document/http_core.html">unbuffered upload</a> directly to HTTP and FastCGI backend servers, which saves disk I/Os.</li><li>Support <a href="document/ngx_http_ssl_asynchronous_mode.html">asynchronous SSL/TLS mode</a> , Could use <a href="document/tengine_qat_ssl.html">QAT to offload and accelerated SSL</a>.</li><li>More load balancing methods, e.g., <a href="document/http_upstream_consistent_hash.html">consistent hashing</a>, <a href="document/http_upstream_session_sticky.html">session persistence</a>, <a href="document/http_upstream_check.html">upstream health check</a>, and <a href="document/http_upstream_dynamic.html">resolving upstream domain names on the fly</a>.</li><li><a href="http://wiki.nginx.org/HttpLuaModule" target="_blank" rel="external">Dynamic scripting language (Lua)</a> support, which is very efficient and makes it easy to extend core functionalities.</li><li>Support <a href="document/stream_sni.html">server_name in Stream modlue</a>.</li></ul></div></div><div class="col-lg-12 info-item info-feature2"><div class="container"><ul><li>Support <a href="document/http_reqstat.html">collecting the running status of Tengine</a> according to specific key (domain, url, etc).</li><li><a href="document/ngx_limit_upstream_tries.html">Limits retries for upstream servers</a> (proxy, memcached, fastcgi, scgi, uwsgi).</li><li>Includes a mechanism to support <a href="document/proc.html">standalone processes</a>.</li><li><a href="document/http_sysguard.html">Protects the server</a> in case system load or memory use goes too high.</li><li><a href="document/http_concat.html">Multiple CSS or JavaScript requests can be combined</a> into one request to reduce download time.</li><li><a href="document/http_trim_filter.html">Removes unnecessary white spaces and comments</a> to reduce the size of a page.</li><li>The number of worker processes and CPU affinities can be set automatically.</li><li><a href="document/http_limit_req.html">The limit_req module</a> is enhanced with whitelist support and more conditions are allowed in a single location.</li><li><a href="document/http_footer_filter.html">Enhanced diagnostic information</a> makes it easier to troubleshoot errors.</li><li><a href="document/commandline.html">More user-friendly command lines</a>, e.g., showing all compiled-in modules and supported directives.</li><li>Expiration times can be specified for certain MIME types.</li><li>Error pages can be reset to 'default'.</li><li>More</li></ul></div></div><div class="col-lg-12 info-item info-recent"><div class="container"><div class="lead-label"><h2><i class="fa fa-lightbulb-o" aria-hidden="true"></i><span>News</span></h2><div class="bg-border-container"><div class="bg-border"></div></div></div><ul><li>[03/25/2021] <a href="download/tengine-2.3.3.tar.gz">Tengine-2.3.3</a> development version released (<a href="changelog.html#2_3_3">changes</a>).</li><li>[08/20/2019] <a href="download/tengine-2.3.2.tar.gz">Tengine-2.3.2</a> development version released (<a href="changelog.html#2_3_2">changes</a>).</li><li>[06/18/2019] <a href="download/tengine-2.3.1.tar.gz">Tengine-2.3.1</a> development version released (<a href="changelog.html#2_3_1">changes</a>).</li><li>[03/25/2019] <a href="download/tengine-2.3.0.tar.gz">Tengine-2.3.0</a> development version released (<a href="changelog.html#2_3_0">changes</a>).</li><li>[11/11/2018] <a href="download/tengine-2.2.3.tar.gz">Tengine-2.2.3</a> development version released (<a href="changelog.html#2_2_3">changes</a>).</li><li>[01/25/2018] <a href="download/tengine-2.2.2.tar.gz">Tengine-2.2.2</a> development version released (<a href="changelog.html#2_2_2">changes</a>).</li><li>[09/27/2017] <a href="download/tengine-2.2.1.tar.gz">Tengine-2.2.1</a> development version released (<a href="changelog.html#2_2_1">changes</a>).</li><li>[12/02/2016] <a href="download/tengine-2.2.0.tar.gz">Tengine-2.2.0</a> development version released (<a href="changelog.html#2_2_0">changes</a>).</li><li>[12/31/2015] <a href="download/tengine-2.1.2.tar.gz">Tengine-2.1.2</a> stable version released (<a href="changelog.html#2_1_2">changes</a>).</li><li>[08/12/2015] <a href="download/tengine-2.1.1.tar.gz">Tengine-2.1.1</a> stable version released (<a href="changelog.html#2_1_1">changes</a>).</li><li>[12/19/2014] <a href="download/tengine-2.1.0.tar.gz">Tengine-2.1.0</a> development version released (<a href="changelog.html#2_1_0">changes</a>).</li><li>[05/30/2014] <a href="download/tengine-2.0.3.tar.gz">Tengine-2.0.3</a> development version released (<a href="changelog.html#2_0_3">changes</a>).</li><li>[03/28/2014] <a href="download/tengine-2.0.2.tar.gz">Tengine-2.0.2</a> development version released (<a href="changelog.html#2_0_2">changes</a>).</li><li>[03/06/2014] <a href="download/tengine-2.0.1.tar.gz">Tengine-2.0.1</a> development version released (<a href="changelog.html#2_0_1">changes</a>).</li><li>[01/08/2014] <a href="download/tengine-2.0.0.tar.gz">Tengine-2.0.0</a> development version released (<a href="changelog.html#2_0_0">changes</a>).</li></ul></div></div><div class="col-lg-12 info-item info-recent2"><div class="container"><ul><li>[11/22/2013] <a href="download/tengine-1.5.2.tar.gz">Tengine-1.5.2</a> stable version released (<a href="changelog.html#1_5_2">changes</a>).</li><li>[08/29/2013] <a href="download/tengine-1.5.1.tar.gz">Tengine-1.5.1</a> stable version released (<a href="changelog.html#1_5_1">changes</a>).</li><li>[08/04/2013] We presented <a href="download/tengine@alibaba.pdf">Nginx Hacking at Alibaba</a> at <a href="http://coscup.org/2013/en/program/#day2_am" target="_blank" rel="external">COSCUP 2013</a>.</li><li>[07/31/2013] <a href="download/tengine-1.5.0.tar.gz">Tengine-1.5.0</a> stable version released (<a href="changelog.html#1_5_0">changes</a>).</li><li>[05/14/2013] <a href="download/tengine-1.4.6.tar.gz">Tengine-1.4.6</a> development version released (<a href="changelog.html#1_4_6">changes</a>).</li><li>[05/01/2013] <a href="download/tengine-1.4.5.tar.gz">Tengine-1.4.5</a> development version released (<a href="changelog.html#1_4_5">changes</a>).</li><li>[03/21/2013] <a href="download/tengine-1.4.4.tar.gz">Tengine-1.4.4</a> development version released (<a href="changelog.html#1_4_4">changes</a>).</li><li>[01/21/2013] <a href="download/tengine-1.4.3.tar.gz">Tengine-1.4.3</a> development version released (<a href="changelog.html#1_4_3">changes</a>).</li><li>[11/22/2012] <a href="download/tengine-1.4.2.tar.gz">Tengine-1.4.2</a> development version released (<a href="changelog.html#1_4_2">changes</a>).</li><li>[10/10/2012] <a href="download/tengine-1.4.1.tar.gz">Tengine-1.4.1</a> development version released (<a href="changelog.html#1_4_1">changes</a>).</li><li>[09/05/2012] <a href="download/tengine-1.4.0.tar.gz">Tengine-1.4.0</a> development version released (<a href="changelog.html#1_4_0">changes</a>).</li><li>[07/10/2012] We started the <a href="nginx_docs/cn/">Nginx Chinese Documentation Translation Project</a>.</li><li>[06/28/2012] Our <a href="http://nginx.org/cn/" target="_blank" rel="external">Chinese translation of Nginx's documentation</a> was accepted by the Nginx team.</li><li>[06/09/2012] We presented <a href="download/taobao_nginx_2012_06.pdf">Nginx Use Cases and Development at Taobao</a> at ECOC Conference.</li><li>[05/25/2012] <a href="download/tengine-1.3.0.tar.gz">Tengine-1.3.0</a> stable version released (<a href="changelog.html#1_3_0">changes</a>).</li><li>[05/09/2012] <a href="download/tengine-1.2.5.tar.gz">Tengine-1.2.5</a> stable version released (<a href="changelog.html#1_2_5">changes</a>).</li><li>[03/30/2012] <a href="download/tengine-1.2.4.tar.gz">Tengine-1.2.4</a> stable version released (<a href="changelog.html#1_2_4">changes</a>).</li><li>[03/08/2012] We are writing <a href="book/index.html">an open book on Nginx development</a>.</li><li>[02/27/2012] <a href="download/tengine-1.2.3.tar.gz">Tengine-1.2.3</a> stable version released (<a href="changelog.html#1_2_3">changes</a>).</li><li>[01/11/2012] <a href="download/tengine-1.2.2.tar.gz">Tengine-1.2.2</a> stable version released (<a href="changelog.html#1_2_2">changes</a>).</li><li>[12/07/2011] We gave a talk on <a href="http://velocity.oreilly.com.cn/2011/index.php?func=session&amp;name=%E6%89%93%E9%80%A0%E5%AE%89%E5%85%A8%E3%80%81%E6%98%93%E8%BF%90%E7%BB%B4%E7%9A%84%E9%AB%98%E6%80%A7%E8%83%BDWeb%E5%B9%B3%E5%8F%B0%EF%BC%9A%E6%B7%98%E5%AE%9D%E7%BD%91Nginx%E5%AE%9A%E5%88%B6%E5%BC%80%E5%8F%91%E5%AE%9E%E6%88%98" target="_blank" rel="external">Hacking Nginx</a> at Velocity China 2011.</li><li>[12/06/2011] <a href="download/tengine-1.2.1.tar.gz">Tengine-1.2.1</a> stable version released (<a href="changelog.html#1_2_1">changes</a>).</li><li>[12/02/2011] <a href="opensource.html">Tengine goes open source.</a></li></ul></div></div></div></div></section></div><div class="container-fluid global-footer"><div class="row"><div class="container"><div class="row"><div class="col-lg-6 col-xs-6"><div class="footer-logo"></div></div><div class="col-lg-6 col-xs-6 clearfix"><select class="lang-switch pull-right"></select></div><div class="col-lg-12 col-lg-offset-0 col-xs-offset-1 col-xs-10"><span class="footer-text copyright">&copy; 2011-2021 <a href="http://www.alibabagroup.com/en/global/home" target="_blank">Alibaba Group</a>. All rights reserved.</span> <span class="footer-text design-by">Designed by Aliyun UED AX, Proudly powered by <a href="https://github.com/alibaba/tengine" target="_blank">Tengine</a> on <a href="https://www.aliyun.com/" target="_blank">Aliyun</a>.</span></div></div></div></div></div><script src="/js/base.min.js"></script><script src="/js/app.min.js"></script></body></html>
bksxznpy

bksxznpy2#

What is the MIME type of your response specifically?

Pls. give the URL and response html specifically.

mbzjlibv

mbzjlibv3#

if I got url from curl - its good
trim is work

< HTTP/2 200
< server: Tengine
< date: Tue, 05 Dec 2023 08:29:46 GMT
< content-type: text/html;charset=UTF-8
< vary: Accept-Encoding
< etag: afc30f5a3db5cfeeffb8a93f853e1cce
< vary: Accept-Encoding
< expires: Tue, 05 Dec 2023 08:29:46 GMT
< cache-control: max-age=0
< strict-transport-security: max-age=63072000; includeSubdomains; preload
< x-content-type-options: nosniff
< x-xss-protection: 1; mode=block
< last-modified: Tue, 05 Dec 2023 08:29:46 GMT

when I try from browser - no good
trim not work

:status: 200
Cache-Control: max-age=0
Content-Encoding: gzip
Content-Length: 41188
Content-Type: text/html;charset=UTF-8
Date: Tue, 05 Dec 2023 08:30:30 GMT
ETag: bc013e38b84f461976d0e45098b550fe
Expires: Tue, 05 Dec 2023 08:30:30 GMT
Last-Modified: Tue, 05 Dec 2023 08:30:30 GMT
Server: Tengine
Strict-Transport-Security: max-age=63072000; includeSubdomains; preload
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block

o7jaxewo

o7jaxewo4#

In your browser, you should clear cache firstly.

Or, disable cache and access again:

6fe3ivhb

6fe3ivhb5#

Moreover, tcpdump both on the browser and Tengine

Then, you will be able to check the response (without comments) of Tengine specifically.

xiozqbni

xiozqbni6#

In your browser, you should clear cache firstly.

Or, disable cache and access again

i clear cache - Be sure

lx0bsm1f

lx0bsm1f7#

Moreover, tcpdump both on the browser and Tengine

Then, you will be able to check the response (without comments) of Tengine specifically.

its then not working

curl ' https://XXX/ '
-H 'authority: XXX'
-H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.7'
-H 'accept-language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7'
-H 'cache-control: no-cache'
-H 'cookie: rrpvid=284325822774850; rcuid=6316068ff07a9bab2639ed7c; _ym_uid=1662387856981919529; fromcity_id=1; city_id=1; offid3=18; offid_phone=18; tabCookie0=0; tmr_lvid=3538c831ca473f988964da4b50b60c6c; tmr_lvidTS=1684933059472; locationModalConfirm=Moscow; rrlevt=1689928836604; friend_phone=%23search-results; _ym_d=1700489389; _pk_id.1.6b29=bc328ef72cd992e6.1700489433.; _pk_id.1.5fa1=2ef9cc40f27b580c.1700489433.; session_init=true; _gid=GA1.2.231223324.1702476401; counterVisitedPages=1; _ga_TCXF2WBQL7=GS1.1.1702476400.31.0.1702476400.60.0.0; startAdvert=start_jivo; JivoSiteLoaded=1; _ym_isad=2; _pk_ses.1.5fa1=1; user1001nw=bc328ef72cd992e6; tmr_detect=0%7C1702476403562; resultComebackerShowClose=true; _ga=GA1.2.1712846012.1662387856; spsearch=1; 60sec_ap=36; comebacker_price_calc_Start=60000; comebacker_price_calc_Stop=true; country_id=1; comebacker_price_calc=true; rrwps=true; rrwps=true; tzm_agreement=iagree; 120sec_ap=4; _pk_ref.1.6b29=%5B%22%22%2C%22%22%2C1702476726%2C%22https%3A%2F%2Fhotels.XXX%2F%22%5D'
-H 'pragma: no-cache'
-H 'sec-ch-ua: "Not_A Brand";v="8", "Chromium";v="120", "Google Chrome";v="120"'
-H 'sec-ch-ua-mobile: ?0'
-H 'sec-ch-ua-platform: "macOS"'
-H 'sec-fetch-dest: document'
-H 'sec-fetch-mode: navigate'
-H 'sec-fetch-site: none'
-H 'sec-fetch-user: ?1'
-H 'upgrade-insecure-requests: 1'
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
--compressed

  • Trying XXX:443...
  • Connected to XXX (XXX) port 443 (#0)
  • ALPN: offers h2,http/1.1
  • (304) (OUT), TLS handshake, Client hello (1):
  • CAfile: /etc/ssl/cert.pem
  • CApath: none
  • (304) (IN), TLS handshake, Server hello (2):
  • (304) (IN), TLS handshake, Unknown (8):
  • (304) (IN), TLS handshake, Certificate (11):
  • (304) (IN), TLS handshake, CERT verify (15):
  • (304) (IN), TLS handshake, Finished (20):
  • (304) (OUT), TLS handshake, Finished (20):
  • SSL connection using TLSv1.3 / AEAD-AES256-GCM-SHA384
  • ALPN: server accepted h2
  • Server certificate:
  • subject: CN=*.XXX
  • start date: Apr 10 17:34:59 2023 GMT
  • expire date: May 11 17:34:58 2024 GMT
  • subjectAltName: host "XXX" matched cert's "*.XXX
  • issuer: C=BE; O=GlobalSign nv-sa; CN=AlphaSSL CA - SHA256 - G4
  • SSL certificate verify ok.
  • using HTTP/2
  • h2 [:method: GET]
  • h2 [:scheme: https]
  • h2 [:authority: XXX]
  • h2 [:path: /]
  • h2 [accept-encoding: deflate, gzip]
  • h2 [authority: XXX]
  • h2 [accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.7]
  • h2 [accept-language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7]
  • h2 [cache-control: no-cache]
  • h2 [cookie: rrpvid=284325822774850; rcuid=6316068ff07a9bab2639ed7c; _ym_uid=1662387856981919529; fromcity_id=1; city_id=1; offid3=18; offid_phone=18; tabCookie0=0; tmr_lvid=3538c831ca473f988964da4b50b60c6c; tmr_lvidTS=1684933059472; locationModalConfirm=Moscow; rrlevt=1689928836604; friend_phone=%23search-results; _ym_d=1700489389; _pk_id.1.6b29=bc328ef72cd992e6.1700489433.; _pk_id.1.5fa1=2ef9cc40f27b580c.1700489433.; session_init=true; _gid=GA1.2.231223324.1702476401; counterVisitedPages=1; _ga_TCXF2WBQL7=GS1.1.1702476400.31.0.1702476400.60.0.0; startAdvert=start_jivo; JivoSiteLoaded=1; _ym_isad=2; _pk_ses.1.5fa1=1; user1001nw=bc328ef72cd992e6; tmr_detect=0%7C1702476403562; resultComebackerShowClose=true; _ga=GA1.2.1712846012.1662387856; spsearch=1; 60sec_ap=36; comebacker_price_calc_Start=60000; comebacker_price_calc_Stop=true; country_id=1; comebacker_price_calc=true; rrwps=true; rrwps=true; tzm_agreement=iagree; 120sec_ap=4; _pk_ref.1.6b29=%5B%22%22%2C%22%22%2C1702476726%2C%22https%3A%2F%2Fhotels.XXX%2F%22%5D]
  • h2 [pragma: no-cache]
  • h2 [sec-ch-ua: "Not_A Brand";v="8", "Chromium";v="120", "Google Chrome";v="120"]
  • h2 [sec-ch-ua-mobile: ?0]
  • h2 [sec-ch-ua-platform: "macOS"]
  • h2 [sec-fetch-dest: document]
  • h2 [sec-fetch-mode: navigate]
  • h2 [sec-fetch-site: none]
  • h2 [sec-fetch-user: ?1]
  • h2 [upgrade-insecure-requests: 1]
  • h2 [user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36]
  • Using Stream ID: 1 (easy handle 0x7f7aee80ce00)
    GET / HTTP/2
    Host: XXX
    Accept-Encoding: deflate, gzip
    authority: XXX
    accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.7
    accept-language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7
    cache-control: no-cache
    cookie: rrpvid=284325822774850; rcuid=6316068ff07a9bab2639ed7c; _ym_uid=1662387856981919529; fromcity_id=1; city_id=1; offid3=18; offid_phone=18; tabCookie0=0; tmr_lvid=3538c831ca473f988964da4b50b60c6c; tmr_lvidTS=1684933059472; locationModalConfirm=Moscow; rrlevt=1689928836604; friend_phone=%23search-results; _ym_d=1700489389; _pk_id.1.6b29=bc328ef72cd992e6.1700489433.; _pk_id.1.5fa1=2ef9cc40f27b580c.1700489433.; session_init=true; _gid=GA1.2.231223324.1702476401; counterVisitedPages=1; _ga_TCXF2WBQL7=GS1.1.1702476400.31.0.1702476400.60.0.0; startAdvert=start_jivo; JivoSiteLoaded=1; _ym_isad=2; _pk_ses.1.5fa1=1; user1001nw=bc328ef72cd992e6; tmr_detect=0%7C1702476403562; resultComebackerShowClose=true; _ga=GA1.2.1712846012.1662387856; spsearch=1; 60sec_ap=36; comebacker_price_calc_Start=60000; comebacker_price_calc_Stop=true; country_id=1; comebacker_price_calc=true; rrwps=true; rrwps=true; tzm_agreement=iagree; 120sec_ap=4; _pk_ref.1.6b29=%5B%22%22%2C%22%22%2C1702476726%2C%22https%3A%2F%2FXXX%2F%22%5D
    pragma: no-cache
    sec-ch-ua: "Not_A Brand";v="8", "Chromium";v="120", "Google Chrome";v="120"
    sec-ch-ua-mobile: ?0
    sec-ch-ua-platform: "macOS"
    sec-fetch-dest: document
    sec-fetch-mode: navigate
    sec-fetch-site: none
    sec-fetch-user: ?1
    upgrade-insecure-requests: 1
    user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36

< HTTP/2 200
< server: Tengine
< date: Wed, 13 Dec 2023 14:16:02 GMT
< content-type: text/html;charset=UTF-8
< content-length: 41744
< etag: aa856f43cbb6f2281c0e4defb922716e
< vary: Accept-Encoding
< content-encoding: gzip
< expires: Wed, 13 Dec 2023 14:16:02 GMT
< cache-control: max-age=0
< strict-transport-security: max-age=63072000; includeSubdomains; preload
< x-content-type-options: nosniff
< x-xss-protection: 1; mode=block
< last-modified: Wed, 13 Dec 2023 14:16:02 GMT
<

相关问题