hi-nginx是是基于nginx最新版开发的多语言通用服务器,它不仅继承了nginx的全部功能,100%兼容nginx,而且支持多种语言直接开发web应用。不仅性能强劲,而且易于开发,部署方便。目前,hi-nginx直接支持使用c++和python进行web应用开发,而无需其他后端应用服务器。hi-nginx本身就合并了后端服务器的功能。 hi-nginx还提供两个基于tengine和openresty的分支版本。因此,hi-nginx实际上还支持直接使用lua语言进行web开发。 此次发布的是hi-nginx-1.0.2。主要更新如下: 更新nginx至最新版1.13.1 添加基于redis和hiredis的session会话机制 添加基于boost.python的python语言支持 c++例子: #include "servlet.hpp" namespace hi{ class hello : public servlet { public: void handler(request& req, response& res) { res.headers.find("Content-Type")->second = "text/plain;charset=UTF-8"; res.content = "hello,world"; res.status = 200; } }; } extern "C" hi::servlet* create() { return new hi::hello(); } extern "C" void destroy(hi::servlet* p) { delete p; } python例子: location = /pyecho { hi_python_content "hi_res.status(200)\nhi_res.content('hello,world')" ; } location ~ \.py$ { hi_python_script python; } 更多使用说明请移步: https://github.com/webcpp/hi https://github.com/webcpp/hi_demo https://github.com/webcpp/tengine https://github.com/webcpp/openresty 多语言通用服务器 hi-nginx V1.0.2 发布下载地址