The SCGI Engine plugin provides engine support for connecting to a SCGI-compliant web server. This can provide faster responses and better reliability than proxying through the built-in Raw engine in Ambition.
Most web servers provide SCGI support. These include, but are not limited to: * Apache * Lighttpd * Microsoft IIS (with ISAPI SCGI extension) * nginx
The engine-scgi plugin can be installed using the usual Ambition plugin tool, and can be used immediately without configuration with sensible defaults. The plugin will link with your application. To always use SCGI, app.engine
must be set to SCGI in your configuration file. Otherwise, to use the SCGI for one session, execute:
ambition run --engine SCGI
To change the configuration of the SCGI plugin, you may use the ambition shell. To set the engine to SCGI, execute:
ambition scgi configure
To set the engine using another port, add the port to the end. All values will replace previous instances.
ambition scgi configure 3201
Otherwise, edit your application's configuration file in the config/
directory.
scgi.port - Listening port of the SCGI server, and should match the web server configuraion. Defaults to 3200.
scgi.threads - Number of listening threads for the SCGI server. Defaults to 10.
server {
listen 80;
location / {
include scgi_params;
scgi_pass 127.0.0.1:3200;
}
location /static {
root /path/to/your/application/;
}
}
<VirtualHost *:80>
DocumentRoot /path/to/empty/directory;
Alias /static/ /path/to/your/application/static/;
SCGIMount / 127.0.0.1:3200
<LocationMatch "/static">
SCGIHandler Off
</LocationMatch>
</VirtualHost>