Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

nginx output problem

$
0
0
I have a program (like prg) which can receive some requests and return something(like a reply message).I wonder if a client send some requests through nginx to this program,how can I give the client the reply produced by the program?
Firstly I tried fastcgi and C.I wrote a fastcgi C program to fork a process to execute the program(prg).But unfortunately it didn't work ,although the cgidemo can run on my machine,and I can type some requests and get some reply.But with nginx there was no output.And it just said some error happened.
And someoen told me that I can develope a nginx module to execute the program prg.And get its file descriptor.Then use dup2 to rewrite the output to the file descriptor and return to the client.But I just feel a bit confused about getting the file descriptor,how can I do it ?Or is there any other way to do this job?

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>