tengine README

The project's README from github.com/alibaba/tengine. As one markdown file: README.md.


Tengine

Visit tengine.taobao.org for the full documentation, examples and guides.

GitHub license GitHub stars GitHub stars Build Status

Introduction

Tengine is a high-performance web server and reverse proxy originated by Taobao, the largest e-commerce website in Asia. It offers HTTP/3, Kubernetes Ingress support, zero-downtime dynamic configuration, active upstream health checks, and NTLS/TLCP (SM2/SM3/SM4), while remaining 100% compatible with nginx. Tengine has proven to be very stable and efficient on some of the top 100 websites in the world, including taobao.com and tmall.com.

Tengine has been an open source project since December 2011. It is being actively developed by the Tengine team, whose core members are from Taobao, Sogou and other Internet companies. Tengine is a community effort and everyone is encouraged to get involved.

Features

Installation

Container image

Multi-arch (amd64 + arm64) images with the full feature set -- Tongsuo (NTLS), xquic (QUIC/HTTP-3) and Lua -- are published on every release:

docker pull ghcr.io/alibaba/tengine:latest         # Debian based
docker pull ghcr.io/alibaba/tengine:latest-alpine  # Alpine based, smaller

docker run --rm -p 8080:80 ghcr.io/alibaba/tengine:latest

The server runs as /usr/sbin/tengine with /etc/tengine/tengine.conf; drop your own server blocks into /etc/tengine/conf.d/.

Distribution packages

Every release ships .rpm, .deb and .apk packages for the mainstream distributions (RHEL/Rocky/Alma/Anolis/openEuler/SLES, Debian/Ubuntu, Alpine) on both x86_64 and aarch64, attached to the release page:

dnf install https://github.com/alibaba/tengine/releases/download/3.2.0/tengine-3.2.0-<ts>.el9.x86_64.rpm

These packages install alongside a distribution nginx without conflicting. See packages/build/README.md for the exact feature set, how to build them yourself, and how the container images are produced.

From source

Tengine can be downloaded at https://tengine.taobao.org/download/tengine.tar.gz. You can also checkout the latest source code from GitHub at https://github.com/alibaba/tengine

To install Tengine, just follow these three steps:

./configure
make
sudo make install

By default, it will be installed to /usr/local/tengine. Everything is named after Tengine, which matches the layout used by the .rpm/.deb/.apk packages and the container images:

Default path
binary /usr/local/tengine/sbin/tengine
configuration /usr/local/tengine/conf/tengine.conf
pid file /usr/local/tengine/logs/tengine.pid
error log /usr/local/tengine/logs/error.log
access log /usr/local/tengine/logs/access.log
dynamic modules /usr/local/tengine/modules

You can use the '--prefix' option to specify the root directory, or --sbin-path, --conf-path, --pid-path, --error-log-path and --http-log-path to place the individual files. If you want to know all the 'configure' options, you should run './configure --help' for help.

Upgrading from 3.1.0 or earlier. Those releases installed to /usr/local/nginx as sbin/nginx driven by conf/nginx.conf. Because 3.2.0 writes to different paths, make install does not replace that install -- the old binary stays on disk and keeps serving traffic, and running it still reports the old version, which easily reads as "the upgrade did not take effect". After switching over, stop and remove the old install, and update any systemd unit, init script or log rotation config still pointing at the old paths. configure prints a warning when it finds an install at /usr/local/nginx/sbin/nginx.

To keep the previous layout instead, pass the old paths explicitly:

./configure --prefix=/usr/local/nginx \
    --sbin-path=/usr/local/nginx/sbin/nginx \
    --conf-path=/usr/local/nginx/conf/nginx.conf \
    --pid-path=/usr/local/nginx/logs/nginx.pid

A plain ./configure builds without Tongsuo, xquic and Lua -- those need their own libraries. To reproduce the full feature set of the released packages and images, use the packaging helpers:

packages/build/fetch-deps.sh                       # download pinned sources
packages/build/build-deps.sh --libdir /usr/lib/tengine
. dist/deps-build/deps-env.sh
./configure $(sh packages/build/configure-args.sh) \
    --with-cc-opt="-Wno-error" \
    --with-ld-opt="$(sh packages/build/configure-args.sh --print-ld-opt)" \
    --with-openssl-opt="$(sh packages/build/configure-args.sh --print-openssl-opt)"
make

Documentation

The homepage of Tengine is at https://tengine.taobao.org/ You can access https://tengine.taobao.org/documentation.html for more information.

Contact

https://github.com/alibaba/tengine/issues

Dingtalk user group: 23394285

License

BSD-2-Clause License

Tengine

tengine (alibaba/tengine)

http3
Searching Database…

13.4K ·GitHub
What is this?Tengine is a high-performance web server and reverse proxy originated by Taobao, built as a fork of nginx that stays 100% compatible with it while adding extra enterprise features.
Is it basically nginx with extra features, or a totally different server?It inherits all features of nginx (currently based on nginx-1.31.5) and is 100% compatible with it, so existing nginx configs and modules work, but it adds its own features like HTTP/3, dynamic config and Lua scripting on top.
How do I install and run it?You can pull the multi-arch container image, install prebuilt .rpm/.deb/.apk packages for mainstream distros, or build from source with ./configure, make, make install (installs to /usr/local/tengine by default).
Do I need extra libraries for features like QUIC or SM2 TLS?Yes — a plain ./configure builds without Tongsuo, xquic and Lua; those need their own libraries, so to get the full feature set (NTLS/TLCP, HTTP/3, Lua) you must build with the packaging helpers or use the prebuilt container images/packages.
Is upgrading from an older Tengine version straightforward?No — upgrading from 3.1.0 or earlier is tricky: those versions installed to /usr/local/nginx, but 3.2.0+ uses different paths, so make install won't replace the old binary and the old server keeps running, making it look like the upgrade silently failed unless you manually stop the old install and update your service configs.
Who typically uses this, and does it work with Kubernetes?It's aimed at sites needing nginx-level performance plus extras, proven on top-100 websites like taobao.com and tmall.com, and ships a companion tengine-ingress Kubernetes Ingress controller for dynamic, reload-free config of servers and upstreams.
What is NTLS/TLCP support for?It adds dual-certificate TLS using the Chinese national SM2/SM3/SM4 cryptographic algorithms (via Tongsuo), per the GM/T 0024 standard, mainly for compliance with Chinese security requirements.
Does Tengine support HTTP/3?Yes, it integrates the xquic library to support QUIC v1 and draft-29, giving lower latency and better resilience on unstable networks.
What happens if a backend server fails?Tengine performs active upstream health checks and can fail over to a backup upstream or redirect based on the response status code, with retry limits for proxy/memcached/fastcgi/scgi/uwsgi backends.
Can I extend Tengine's behavior with scripts?Yes, it has built-in Lua scripting support, letting you extend core functionality efficiently, including writing custom Web Application Firewalls using its input body filter mechanism.
Creator
alibaba
Size
25.9 MB
Stars
13.4K
Age
14y
Commits · 90 Days