configuratioin fastcgi C/C++ program

Almir Karic almir at almirkaric.com
Wed Jun 2 03:31:39 MSD 2010


On Tue, Jun 1, 2010 at 12:31 PM, JCR <nginx-forum at nginx.us> wrote:
> hello
>
> I have a fastcgi program like this
> [code]
>      1 #include "/usr/local/include/fcgi_stdio.h"
>      2 #include <stdlib.h>
>      3 int count;
>      4 void initialize(void)
>      5 {
>      6   count=0;
>      7 }
>      8 int main(void)
>      9 {
>     10   initialize();
>     11
>     12   while (FCGI_Accept() >= 0)
>     13   {
>     14     printf("Content-type: text/html\r\n"
>     15            "\r\n"
>     16            "<title>FastCGI Hello! (C, fcgi_stdio library)</title>"
>     17            "<h1>FastCGI Hello! (C, fcgi_stdio library)</h1>"
>     18            "Request number %d running on host <i>%s</i>\n",
>     19            ++count, getenv("SERVER_HOSTNAME"));
>     20   }
>     21   return 1;
>     22 }
> [/code]
>
> which compiles fine but I am unable to configure nginx to execute it.

you need to plug your code to a socket/port. nginx than talks to that
with fcgi_pass.


http://supervisord.org/configuration.html

this is one of the options that can plug your code to socket/port (the
"fcgi-program" directive)


>
> I read http://wiki.nginx.org/NginxConfiguration but to no avail.
>
> Also, once I will have figured this out, I will need that program to work with the nginx_http_push_module-0.692
>
> Nginx is otherwise working fine on my Centos 5 machine.
>
> Could anyone point me to an example for such a configuration.
>
> Thank you
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,93268,93268#msg-93268
>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx
>



-- 
python/django hacker & sys admin
http://almirkaric.com & http://twitter.com/redduck666



More information about the nginx mailing list