Simple Common Gateway Interface

The Simple Common Gateway Interface ( SCGI ) is a standard for exchanging data between a Web server and third software that handled the requests. It is an alternative to classical CGI and resembles the FastCGI protocol.

The specification was created by Neil Scheme Auer and published on 12 January 2006 as a public-domain specification. Compared to the SCGI FastCGI protocol is easier to implement; Modern Web server now offer equally support for FastCGI and SCGI.

Protocol Description

Each SCGI request ( engl. request) consists of a list of headers ( description of the content ) and a body (content). The headers are encoded as Netstring and then followed by the body on its own connection to SCGI application sent. The connection remains exist and is only after the SCGI application Launch has sent a response, closes.

Since SCGI request begins with ASCII '1 'to '9' byte, it can be distinguished from an HTTP Forward - a current SCGI application can be easily set in a position equally SCGI requests and HTTP GET to treat / POST requests.

For the answer, no format is defined in the protocol. However, it is as common CGI that begins with the status response parameters.

Header

As shown above, there is every header of a key-value pair (English key-value pair). Here, the key is the header is separated by an ASCII null ( NUL ) of the value, and terminated with an ASCII null ( NUL ). Each key must be unique and therefore may only occur once.

SCGI request

The first header must have the key " CONTENT_LENGTH " and must not be empty, even if the length of the body is 0. Then a header with the key " SCGI " and the value 1 must be available. All other headers are optional.

Web server support

The following Web servers support the SCGI protocol.

  • Apache HTTP Server
  • Lighttpd
  • Cherokee HTTP Server
  • Nginx server

Language binding

The following programming languages ​​support the creation of SCGI applications by voice connection:

  • D
  • Ruby
  • Python
  • Lisp
  • Perl
  • Haskell
  • Java
  • PHP
711887
de