On 03/06/18 16:39, Diogo Galvao wrote:
The following patch makes it possible to handle all FastCGI requests
with a single script so it can route clean URLs itself.

Was it already possible some other way?

It's already possible to achieve the same result with the root option:

server "example.com" {
        listen on * port 80
        root "/htdocs/example.com"
        location "*" {
                fastcgi socket "/run/php-fpm.sock"
                root "/htdocs/example.com/router.php"

So below is a small addition to httpd.conf.5 to make it more obvious to
future users, in case you find it relevant.

Sorry for the noise.

Index: httpd.conf.5
RCS file: /cvs/src/usr.sbin/httpd/httpd.conf.5,v
retrieving revision 1.89
diff -u -p -u -p -r1.89 httpd.conf.5
--- httpd.conf.5        4 Jan 2018 20:38:12 -0000       1.89
+++ httpd.conf.5        7 Mar 2018 22:59:17 -0000
@@ -468,6 +468,16 @@ root directory of
 .Nm httpd .
 If not specified, it defaults to
 .Pa /htdocs .
+.It Ar script
+When served by FastCGI, the
+.Ic root
+option may be the pathname to the single script within the
+.Xr chroot 2
+root directory that's responsible for handling all requests. In this case,
+the actual path requested by the client is made available to the FastCGI
+handler in the
 .It Ic strip Ar number
 .Ar number

Reply via email to