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)

Searching Database…

13.4K ·GitHub
Что это такое?Tengine — высокопроизводительный веб-сервер и обратный прокси, разработанный компанией Taobao. Это форк nginx, который остаётся на 100% совместимым с ним и при этом добавляет дополнительные корпоративные возможности.
Это по сути nginx с дополнительными возможностями или совершенно другой сервер?Он наследует все возможности nginx (сейчас основан на nginx-1.31.5) и на 100% совместим с ним, поэтому существующие конфигурации и модули nginx работают. Сверху добавлены собственные возможности, например HTTP/3, динамическая конфигурация и поддержка скриптов на Lua.
Как установить и запустить его?Можно скачать мультиархитектурный контейнерный образ, установить готовые пакеты .rpm/.deb/.apk для популярных дистрибутивов или собрать из исходников командами ./configure, make, make install (по умолчанию устанавливается в /usr/local/tengine).
Нужны ли дополнительные библиотеки для таких функций, как QUIC или SM2 TLS?Да: обычная сборка ./configure выполняется без Tongsuo, xquic и Lua. Этим компонентам нужны собственные библиотеки, поэтому для полного набора возможностей (NTLS/TLCP, HTTP/3, Lua) нужно собирать с помощью вспомогательных инструментов для упаковки или использовать готовые контейнерные образы и пакеты.
Легко ли обновиться с более старой версии Tengine?Нет, обновление с версии 3.1.0 или более ранней непростое. Эти версии устанавливались в /usr/local/nginx, а в 3.2.0 и новее используются другие пути, поэтому make install не заменит старый бинарный файл, и старый сервер продолжит работать. Из-за этого может казаться, что обновление незаметно провалилось, если вы вручную не остановите старую установку и не обновите конфигурации служб.
Кто обычно это использует и работает ли это с Kubernetes?Он рассчитан на сайты, которым нужна производительность уровня nginx плюс дополнительные возможности. Проверен на крупных сайтах из топ-100, таких как taobao.com и tmall.com, и поставляется вместе с контроллером Ingress для Kubernetes под названием tengine-ingress, который динамически настраивает серверы и upstream-группы без перезагрузки.
Для чего нужна поддержка NTLS/TLCP?Она добавляет TLS с двойными сертификатами, использующий китайские национальные криптографические алгоритмы SM2/SM3/SM4 (через Tongsuo) по стандарту GM/T 0024. В первую очередь это нужно для соответствия китайским требованиям безопасности.
Поддерживает ли Tengine HTTP/3?Да, он интегрирует библиотеку xquic для поддержки QUIC v1 и draft-29, что обеспечивает меньшую задержку и лучшую устойчивость в нестабильных сетях.
Что происходит, если бэкенд-сервер выходит из строя?Tengine выполняет активные проверки работоспособности upstream-серверов и может переключиться на резервный upstream или перенаправить запрос в зависимости от кода статуса ответа. Для бэкендов proxy/memcached/fastcgi/scgi/uwsgi действуют ограничения на число повторных попыток.
Можно ли расширить поведение Tengine с помощью скриптов?Да, в нём есть встроенная поддержка скриптов на Lua, которая позволяет эффективно расширять базовую функциональность. С её помощью можно писать собственные межсетевые экраны уровня приложений (WAF) через механизм входного фильтра тела запроса.
Creator
alibaba
Size
25.9 MB
Stars
13.4K
Age
14y
Commits · 90 Days