Friends do not judge strictly for the question. You can explain the work of cgi with the server Nginx. When working on one project I saw this form of sending

 <form id="contectform" action="script.cgi" method="post"> <input type="text" name="name" placehold="name" /> <button type="submit" value="send">Send</button> </form> 

You can tell why data processing refers to script.cgi and not index.php . I will say that the site worked on Nginx. Thank you in advance

  • Possible duplicate question: Apache & Nginx - Alexander Rychkov
  • About CGI indescribably - Rivera Time Club
  • one
    Let's reason logically. With such form data, the form will be sent to the address http (s): //yourdomain.yourdomain/folder_where_form_live/script.cgi In essence, script.cgi in this way does not tell you that the protocol of the web server and the application itself. Nginx will process this request in accordance with the settings, in particular, it will find the desired location and send it to the rules in this location. Even shorter, it seems - cgi has nothing to do with anything else; moreover, in the modern world fast-cgi has been used for a long time, and a comrade just wanted to ... - zalex
  • one
    Address means absolutely nothing. On the server, this script.cgi can be handled as you please with anything. It is possible and vice versa, any address such as index.php can be processed by a nodejs server, for example - andreymal

1 answer 1

Why data processing refers to script.cgi and not index.php?

because the site developer conceived it so that when a user clicks on a button that says send his http client sent a post request with a url

 схема://адрес/путь/script.cgi 

but not

 схема://адрес/путь/index.php 

ps as an http-server available at the specified address will process this request (and whether it will be able to process it at all) depends entirely on the capabilities / settings / configuration of this server itself.