A
A
Apexis2018-01-02 23:26:35
Nginx
Apexis, 2018-01-02 23:26:35

How to run fast-cgi program on nginx?

I want to use c++ instead of php. The server chose nginx. Added settings to nginx.conf:

fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
Compiled the hello_world example using the libfcgi library. Received an .exe file. As I understand it, the application needs to be put in the html folder on nginx, then you need to run it. I don't know how to do it. Tried to do the same on freeBSD, but didn't figure out how to use the spawn-fcgi utility.
OS: windows 7
Launched through the console hello_world.fcgi. The app responded with lib init. After I saw hello world at localhost!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
asd111, 2018-01-03
@Apexis

You don't need to put it in a folder, you need to run it, because fast cgi applications work like a normal server. In theory, your fastcgi application should open port 9000 and listen for incoming connections. Those. Let's say a request comes in on port 80 in nginx, and it redirects the request to your server program on port 9000.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question