Skip to content


Subversion checkout URL

You can clone with
Download ZIP
SCGI module for Nginx
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src Fix bug of wrong content-length when sending GET request



mod_scgi is an implementation of the
`Simple Common Gateway Interface <>`_
for the `Nginx <>`_ web server.

Nginx is a fast asynchronous HTTP server.


mod_scgi has been tested with Nginx 0.5.35.

Download the Nginx sources from and unpack it.

The sources of mod_scgi can be downloaded from a
`Mercurial <>`_ repository:

At the moment there is no stable release, so you need to download the
latest revision (*tip*) or the latest *tag*.

The *tip* can be downloaded via the Mercurial web interface:

or cloning the repository: ::

  hg clone

The latest *tag* can be found from:

To build Nginx, change to the directory which contains the Nginx
sources, and run the configuration script making sure to add the path
to the mod_scgi sources using the --add-module option.
It is recommended to enable debugging. ::

  $ ./configure --add-module=/path/to/mod_scgi/ --with-debug

Nginx will use as default prefix path the directory

Now you can build and install the software: ::

  $ make

and as root: ::

  $ make install


This module is still under development.

The module is mainly an adaptation of the existing
`ngx_http_fastcgi_module`, with some code (the HTTP status line and
headers parsing) from the `ngx_http_proxy_module`.

In the current version `SCRIPT_NAME` and `PATH_INFO` are not defined.

The current implementation also only supports SCGI response that
conforms to HTTP 1.0; this means that the response must start with an
HTTP 1.x status line (like `HTTP 1.0 200 OK`) and not by using the
`Status` header.


This implementation is not fully conform to the SCGI protocol.

The SCGI specification states: ::

  Duplicate names are not allowed in the headers

however Nginx does not combines multiple headers.


Here is a sample configuration: ::

    location  /scgi {

        include     conf/scgi_vars;
        scgi_var    SCRIPT_NAME  /scgi;
        scgi_var    PATH_INFO    /xxx;

note the inclusion of the `conf/scgi_vars` file.

This file must be copied to the nginx `$prefix/conf` directory by
Something went wrong with that request. Please try again.