skip to Main Content

I and a project team are trying to make our server use a C algorithm in background of our hosted website. Our server as bitnami nginx already installed but i can’t find any information on the net about nginx fast cgi and C programms. If you can provide any help, I would be grateful.

We tried looking for informations but all we have found is that nginx does not automatically spawn fast-cgi process.

2

Answers


  1. NGINX has support for 3rd party modules.

    There are two ways.

    1. Since NGINX is written in C, you can write your C Algorithms inside an NGINX location module handler function.

    2. You may need to write an Upstream module and a location module that can redirect HTTP requests coming from clients for any configured location to a backend server where you can write your C algorithm.

    Please check this article https://www.evanmiller.org/nginx-modules-guide.html

    And if you want to use FCGI protocol, You should build NGINX source code with FCGI module and then you have to write an FCGI server in C and there you can implement C Algorithms

    Login or Signup to reply.
  2. Did you already find this fastcgiexample article on http://www.nginx.com?

    It says the following about spawning:

    Unlike Apache or Lighttpd, NGINX does not automatically spawn FCGI
    processes. You must start them separately.

    I have used libfcgi.so with lighttpd. Example program that uses libfcgi.so here: chapter C/C++ FastCGI on lighttpd named socket.

    With NGINX you may need to use TCP sockets (FCGX_OpenSocket) instead of UNIX domain sockets.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search