How do the web server and cgi process interact with each other?

I want to understand how the web server (ex: nginx) and cgi / fastcgi communicate with each other. How the web server passes the cgi script to the cgi process and how the cgi process responds to the request.

In Nginx, we set it up so that nginx passes php-fpm php scripts

 location / {
            root   /home/service/public_html;
            fastcgi_pass   unix:/tmp/php-fpm-test.socket;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /home/service/public_html/index.php;
            include        fastcgi_params;
        }

How it works?

Change: . It would be nice if someone could give me a piece of pseudocode to describe the connection between the process (or any other) and the juice php-fpm unix file.

+5
source share
1 answer

CGI script - HTTP- - / script, (, URL- ), HTTP . script/executable HTTP- -.

CGI . wikipedia perl script, CGI


Fast CGI - CGI - , Fast CGI , CGI HTTP-.

Fast CGI CGI (, ), Fast CGI all .

Fast CGI - , Fast CGI .

+2

All Articles