Tengine-1.2.2

Hi,

We are pleased to announce that Tengine-1.2.2 has been released. And you
can download it here: http://tengine.taobao.org/download/tengine.tar.gz
(For those who don’t know Tengine, it is a distribution of Nginx,
including
quite a few useful patches and modules developed by a group software
engineers from Taobao)

In this release, we introduced the ‘input body filter’ mechanism. So
it’s
very handy to a developer who wants to write a Web Application Firewall.
We
merged the changes from the latest stable Nginx, i.e. Tengine is based
on
Nginx-1.0.11 now. There are also some bug fixes in this release. More
detailed changelog is available at

Have fun, folks!

Regards,

Good stuff! The following feature caught my eye, but I didn’t notice
any documentation / samples (though I might have missed them). Is this
feature-set present in 1.2.2?

-Combines multiple CSS or JavasScript requests into one request to
reduce the downloading time

Side note, the Server header on tengine.taobao.org is ‘Apache’. Say
what!?! :slight_smile:

From: [email protected] [mailto:[email protected]] On Behalf
Of Joshua Z.
Sent: Thursday, January 12, 2012 7:35 AM
To: [email protected]
Subject: [ANNOUNCE] Tengine-1.2.2

Hi,

We are pleased to announce that Tengine-1.2.2 has been released. And you
can download it here: http://tengine.taobao.org/download/tengine.tar.gz
(For those who don’t know Tengine, it is a distribution of Nginx,
including quite a few useful patches and modules developed by a group
software engineers from Taobao)

In this release, we introduced the ‘input body filter’ mechanism. So
it’s very handy to a developer who wants to write a Web Application
Firewall. We merged the changes from the latest stable Nginx, i.e.
Tengine is based on Nginx-1.0.11 now. There are also some bug fixes in
this release. More detailed changelog is available at

Have fun, folks!

Regards,

On 12 Jan 2012 18h39 WET, [email protected] wrote:

Good stuff! The following feature caught my eye, but I didn’t
notice any documentation / samples (though I might have missed
them). Is this feature-set present in 1.2.2?

-Combines multiple CSS or JavasScript requests into one request to
reduce the downloading time

I’ve ripped this module from tengine you can grab it here (I haven’t
checked the new release of tengine for updates to this module) Joshua
was kind enough to help me get the examples in the README:

— appa

Hi,

GitHub - perusio/nginx-http-concat: A Nginx module for concatenating files in a given context: CSS and JS files usually

It doesn’t have license.

Best regards,
Piotr S. < [email protected] >

Hi,

On Thu, Jan 12, 2012 at 11:35 PM, Joshua Z. [email protected]
wrote:

merged the changes from the latest stable Nginx, i.e. Tengine is based on
Nginx-1.0.11 now. There are also some bug fixes in this release. More
detailed changelog is available at
ChangeLog - The Tengine Web Server

I’ve written a post about how to use this ‘input body filter’ to develop
Web Application Firewalls, taking a naive module to fight hash
collision
DoS attacks as an example:

Regards,

On 12 Jan 2012 18h53 WET, [email protected] wrote:

Hi,

GitHub - perusio/nginx-http-concat: A Nginx module for concatenating files in a given context: CSS and JS files usually

It doesn’t have license.

Yes indeed. Fixed now.

Thanks,

— appa

Hello,

Joshua Z., I find http-concat module very useful indeed. Except there
are a few minor issues that hopefully will be fixed in the new
version(s):

  1. It is not possible to define files from alternate folder followed by
    files defined by another folder, for example:

/jquery/??jquery.asmselect.css,ui.imageuploader.css,jquery.linkselect.css
=> works

but

/jquery/??jquery.asmselect.css,ui.imageuploader.css,jquery.linkselect.css,/site-default.css
=> doesn’t work

(site-default.css resides in the root)

Suggestion is therefore if “/” is used as a prefix for consequent files,
then treat this component as absolute URL

  1. Some CSS files may contain relative links to images. However, when
    these CSS files are concatenated using http-concat from a page residing
    in a different folder, links to images will not of course work anymore,
    as they become relative to the current page. For example:
    “jquery-ui-1.8.17.custom.css” of the standard jquery library contains 8
    links to images/* and of course they don’t work.

We wrote our own PHP script to automatically parse CSS files and fix the
url’s by using the following perl regex:

$path = dirname($e[‘uri’]);
// example: url(relative/path/to/file) becomes:
url(/absolute/and/not/relative/path/to/file) within a CSS file
$buf =
preg_replace(‘/(:?\surl\s()['“\s]([^/'"].)['”\s]*)/isU’, ‘$1’
. ($path == ‘/’ ? ‘/’ : $path . ‘/’) . ‘$2)’, $buf);

It doesn’t seem to create a big processing overhead, since the files are
read from disk anyway, and this only does a replace operation in the
memory buffer. what do you say? would it be possible to implement?

Also, Antonio, you did a great job to distribute http-concat on git, but
the link to download the archive does not appear to have a .gz/.zip
extension, and, for example, in Gentoo distribution it creates problems
when using “unpack()” function in its ebuilds, as it doesn’t know what
type of archive it is:

https://nodeload.github.com/perusio/nginx-http-concat/tarball/master

(doesn’t end with “.gz”)

Also, there is no version information.

Best regards

Andrejs

Posted at Nginx Forum: