nginx可以支持c++直接进行模块插件的开发,对post请求的处理大致如下:static ngx_int_t ngx_echo_handler(ngx_http_request_t *r) {if (r->method &(NGX_HTTP_POST)) {ngx_int_t rc = ngx_http_read_client_request_body(r,ngx_recom_handler);if (rc >= NGX_HTTP_SPECIAL_RESPONSE) {return rc;}return NGX_DONE;}return NGX_DONE;}void ngx_recom_handler (ngx_http_request_t *r) {key_vv = ngx_http_get_indexed_variable(r,ngx_http_key_index);string title;string content;bool para_r =get_post_para(r, title, content);//算法逻辑处理过程char dest[65536];//结果字符串//............................//输出结果整理endngx_int_t rc;ngx_buf_t *b;ngx_chain_t out;ngx_ec
...
继续阅读
(37)