From be1c7e50e1e8809ea56f2c9d472eccd8ffd73a97 Mon Sep 17 00:00:00 2001
From: Daniel Baumann
+This document describes the configuration directives of the FastCGI handler.
+
+The configuration directives of the FastCGI handler can be categorized into two groups.
+
+If the argument is a mapping, following properties are recognized.
+Fastcgi.connect
and fastcgi.spawn
define the address (or the process) to which the requests should be sent.
+Other directives customize how the connections to the FastCGI processes should be maintained.
+
+
+host
+type
is unix
)
+port
+type
+tcp
(default) or unix
+
+If the argument is a scalar, the value is considered as a TCP port number and the host is assumed to be 127.0.0.1
.
+
/app
to FastCGI daemon listening to /tmp/fcgi.sock
', <<'EOT');
+hosts:
+ "example.com:80":
+ paths:
+ "/app":
+ fastcgi.connect:
+ port: /tmp/fcgi.sock
+ type: unix
+EOT
+?>
+? })
+
+
+$ctx->{directive}->(
+ name => "fastcgi.spawn",
+ levels => [ qw(path extension) ],
+ desc => q{The directive specifies the command to start the FastCGI process manager.},
+)->(sub {
+?>
+
+In contrast to fastcgi.connect
that connects to a FastCGI server running externally, this directive launches a FastCGI process manager under the control of H2O, and terminates it when H2O quits.
+The argument is a /bin/sh -c
expression to be executed when H2O boots up.
+The HTTP server records the process id of the expression, and sends SIGTERM
to the id when it exits.
+
.php
files to 10 worker processes of /usr/local/bin/php-cgi
', <<'EOT');
+file.custom-handler:
+ extension: .php
+ fastcgi.spawn: "PHP_FCGI_CHILDREN=10 exec /usr/local/bin/php-cgi"
+EOT
+?>
+
+As of version 1.4.0, the spawned process is run under the privileges of user specified by the user
directive (in version 1.3.x, the FastCGI process was spawned under the privileges that spawned the H2O standalone server).
+It is possible to specify a different user for running the FastCGI process, by providing a mapping that contains an attribute named user
together with an attribute named command
.
+
fastcgi
', <<'EOT');
+file.custom-handler:
+ extension: .php
+ fastcgi.spawn:
+ command: "PHP_FCGI_CHILDREN=10 exec /usr/local/bin/php-cgi"
+ user: fastcgi
+EOT
+?>
+? })
+
+
+$ctx->{directive}->(
+ name => "fastcgi.timeout.io",
+ levels => [ qw(global host path extension) ],
+ default => q{fastcgi.timeout.io: 30000},
+ desc => q{Sets the I/O timeout of connections to the FastCGI process in milliseconds.},
+)->(sub {});
+?>
+
+
+$ctx->{directive}->(
+ name => "fastcgi.timeout.keepalive",
+ levels => [ qw(global host path extension) ],
+ default => q{fastcgi.timeout.keepalive: 0},
+ desc => 'Sets the keepl-alive timeout for idle connections in milliseconds.',
+)->(sub {
+?>
++FastCGI connections will not be persistent if the value is set to zero (default). +
+? }) + + +$ctx->{directive}->( + name => "fastcgi.send-delegated-uri", + levels => [ qw(global host path extension) ], + default => q{fastcgi.send-delegated-uri: OFF}, + desc => 'Send the modifiedHTTP_HOST
and REQUEST_URI
being rewritten in case of internal redirect.',
+)->(sub {
+?>
+
+In H2O, it is possible to perform internal redirects (a.k.a. delegations or URL rewrites) using the redirect
directive or by returning X-Reproxy-URL
headers from web applications.
+The directive specifies whether to send the original values to the FastCGI process (default), or if the rewritten values should be sent.
+