From Nginx to Kong: Evolution, Features, and Deployment on Tencent Cloud
This article explains how Nginx evolved into the Kong API gateway through OpenResty, describes Kong’s plugin architecture and micro‑service‑oriented capabilities, and demonstrates setting up and managing Kong with Konga on Tencent Cloud, including monitoring, logging, and high‑availability features.
Hello everyone, I am Fei Ge!
In traditional services, Nginx is widely used as a layer‑7 gateway, but with the rise of micro‑services the Nginx ecosystem has continuously evolved.
In 2007, Chinese developer Zhang Yichun built OpenResty on top of Nginx, and in 2009 Marco created Kong on OpenResty; the project now has over 33k stars.
Today I will use Tencent Cloud to show the various capabilities of Kong.
1. How Nginx Evolved into Kong
Traditional internet services mainly need reverse proxy, load balancing, and routing at the gateway.
A typical architecture uses a layer‑4 LVS for IP convergence and a layer‑7 Nginx for HTTPS access, reverse proxy, load balancing, and routing.
Nginx workers each use an epoll object to efficiently manage massive socket events. See my previous article “Understanding Nginx’s High‑Performance Network Working Principles!”.
Performance issues have been solved, but micro‑services split services into many small units, reducing coupling but making unified management harder.
For example, service discovery: in Nginx, backend services are defined in static config files, requiring manual updates when IPs change.
In micro‑services, containers are used, and each deployment changes IPs; dynamic scaling also changes IPs, so static config updates are no longer sufficient.
Beyond service discovery, modern gateways need rate limiting, protocol conversion, authentication, security, etc.
Nginx is written in C, making extensions costly; each change requires recompilation.
Fortunately, OpenResty embeds LuaJIT into Nginx, allowing easy extension with Lua scripts; after updating Lua code, a simple Nginx reload applies the changes.
My previous work at Sogou Browser used this model to extend Nginx with Lua, achieving simplicity and near‑native performance.
With OpenResty, the path to extend gateway functionality is opened, and Mashape built the Kong gateway on top of it.
Kong’s most elegant design is its plugin mechanism, offering over 60 plugins; specific needs can be met by selecting appropriate plugins.
The plugin system makes Kong highly extensible; if built‑in plugins are insufficient, custom Lua plugins can be developed.
2. Demonstrating Kong’s Features
Setting up Kong is a bit complex; it requires a database such as Postgres or Cassandra to store routes, services, and upstreams, and the Konga management UI.
Tencent Cloud’s Microservice Engine integrates Kong, allowing one‑click deployment.
After configuring and creating a Kong instance, the required database and Konga UI are automatically provisioned.
In Konga, services and routes can be managed via the Service and Route menus.
Most tasks can be completed visually in Konga; for example, adding a certificate involves clicking “CERTIFICATES”, filling in the certificate and key, and submitting.
Service monitoring follows Google SRE’s golden signals (latency, traffic, errors). Kong integrates easily with Prometheus and other cloud‑native components for monitoring.
Kong also integrates with ELK for log viewing and searching.
If long‑term log storage is needed, enabling CLS log service provides persistent storage.
Additionally, the “PLUGINS” menu in Tencent Cloud offers built‑in plugins for authentication, security, operations support, message transformation, and traffic control.
Tencent Cloud’s Kong also supports lossless scaling and multi‑city active‑active high‑availability.
3. Conclusion
In the micro‑service era, gateways need many extensions, which are hard to implement directly in Nginx due to C‑language complexity and recompilation requirements.
OpenResty’s LuaJIT enables simple Lua‑based extensions, and Kong leverages this to provide a plugin‑driven, extensible gateway with many ready‑to‑use plugins.
Using Tencent Cloud’s one‑click deployment and Konga UI, we demonstrated configuring Kong, monitoring golden signals, and performing log retrieval, making deployment and operation convenient and stable.
Overall, Kong is often a better fit than Nginx for modern internet applications.
Last weekend, Tencent held the second “Techno Day” event, introducing Kong’s cloud‑native capabilities and also covering the open‑source Polaris service discovery and governance platform and its gray‑release solution; the content is compiled in the “Tencent Cloud Native Tools Guide” for interested readers.
Refining Core Development Skills
Fei has over 10 years of development experience at Tencent and Sogou. Through this account, he shares his deep insights on performance.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.