Nginx module development with mysql posible?

纵然是瞬间 提交于 2019-12-25 00:06:12

问题


I'm trying to program an nginx module that discounts traffic from a Mysql database , upon a user based criteria. I don't know where to start I just know the concept of it, probably calling upon the event for sending bytes (let's say every 10 mb or so use a mysql library in C and do a query to discount the traffic) Is it possbile? can anyone give me some hints? I know there arrent' so many nginx developpers out there. I can do it on lighthttpd or apache I just need some help with it. Thank you


回答1:


I also tried to use nginx for C developments but finally opted for G-WAN.

Not only G-WAN's C scripts work faster than nginx modules but you don't have to configure anything and they play 'out-of-the-box'.

The traditional 'hello world' lets you see how this compares to nginx or Apache modules (ONLY 10 LINES OF CODE!):

http://gwan.ch/en_developers.html

One recent addition is the #prama link directive which lets you link your scripts with any existing library (just like mySQL, PostgreSQL or even SQLite).

There's an example with SQLite here:

http://gwan.ch/source/sqlite.c.txt



来源:https://stackoverflow.com/questions/4204812/nginx-module-development-with-mysql-posible

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!