Welcome! Log In Create A New Profile

Advanced

nginx output problem

Posted by asddsa 
nginx output problem
July 18, 2019 04:44AM
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?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 296
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready