Search code examples
c++httpnode.jsnginxfastcgi

Best method to create a c++ app to communicate with nginx


I need to write a C++ interface that can read our data structure and provide the o/p based on query using http protocol.

Server Need
It should be able to serve 100 clients at the same time.

Why C++
All code is already written in C++. So we need to just write a http layer in C++. That's why I am choosing C++ instead of a more conventional web-programming language.

I am thinking to use nginx to serve static files and use its proxy pass to communicate with C++.

There are two approaches I have found:

  • Write a FastCGI c++ module.

  • Write a node.js c++ module.

  • Please just any other suggestion if you have

Can you please list the pros and cons for each method based on prior experience?


Solution

  • I think I will go forward with Nginx module devlopment http://www.evanmiller.org/nginx-modules-guide.html

    Why ?

    1. It don't require any other library dependency like fastcgi and other.
    2. I can use all feature of nginx inside my module.