Nginx模块可以用mysql开发吗?

发布于 2024-10-02 13:24:30 字数 205 浏览 0 评论 0原文

我正在尝试编写一个 nginx 模块,该模块根据基于用户的标准来折扣来自 Mysql 数据库的流量。 我不知道从哪里开始我只知道它的概念,可能调用发送字节的事件(假设每 10 mb 左右使用 C 中的 mysql 库并执行查询来折扣流量) 有可能吗?谁能给我一些提示吗?我知道那里没有那么多 nginx 开发人员。 我可以在 lighthttpd 或 apache 上完成,我只需要一些帮助。谢谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烛影斜 2024-10-09 13:24:30

我也尝试过使用 nginx 进行 C 开发,但最终选择了 G-WAN。

G-WAN 的 C 脚本不仅比 nginx 模块运行得更快,而且您无需配置任何内容,而且它们可以“开箱即用”。

传统的“hello world”让您了解它与 nginx 或 Apache 模块的比较(只有 10 行代码!):

http ://gwan.ch/en_developers.html

最近添加的一项内容是#prama link 指令,它允许您将脚本与任何现有库(就像 mySQL、PostgreSQL 甚至 SQLite)链接。

这里有一个 SQLite 的例子:

http://gwan.ch/source/sqlite.c.txt< /a>

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文