Commit Diff


commit - fdd67729b45c7073be9ea1720cbadbaae8f0d112
commit + 6a8387e5f54a4d6db07aa2f3c7046f618b82aac2
blob - 8e81498bc910d365ee024df56062c609efcbe103
blob + 0a1c175d0479b48648a7f6a79797e380d23d79a1
--- gmid.conf.5
+++ gmid.conf.5
@@ -320,6 +320,8 @@ certificate in the ISO 8601 format
 The time corresponding to the start of the validity period of the peer
 certificate in the ISO 8601 format.
 .El
+.It Ic fastcgi off
+Disable FastCGI handling in the current location.
 .It Ic index Ar string
 Set the directory index file.
 If not specified, it defaults to
blob - 337fb0cd3c19959e03906c2b31d8925b032114f7
blob + e361ed5baea6fae335c2bd60cece60e89fb4ae8c
--- gmid.h
+++ gmid.h
@@ -175,6 +175,7 @@ struct location {
 	X509_STORE	*reqca;
 	int		 disable_log;
 	int		 fcgi;
+	int		 nofcgi;
 	struct envhead	 params;
 
 	char		 dir[PATH_MAX];
blob - 2dcb4bc5a1edbb6cb2bd722b275f7529256791f0
blob + c5f535fff91dba7860145dbb76eeb7bddc4ac7e6
--- parse.y
+++ parse.y
@@ -491,6 +491,10 @@ locopt		: AUTO INDEX bool	{ loc->auto_index = $3 ? 1 :
 
 fastcgi		: FASTCGI '{' optnl fastcgiopts '}'
 		| FASTCGI fastcgiopt
+		| FASTCGI OFF {
+			loc->fcgi = -1;
+			loc->nofcgi = 1;
+		}
 		| FASTCGI string {
 			yywarn("`fastcgi path' is deprecated.  "
 			    "Please use `fastcgi socket path' instead.");
blob - 88479f1e797759712b76b50494e83a023e2760d7
blob + 3bceac609b9db524b8bfe314dee04b63d2562061
--- server.c
+++ server.c
@@ -247,6 +247,7 @@ struct location *
 vhost_fastcgi(struct vhost *v, const char *path)
 {
 	struct location *loc;
+	int force_disable = 0;
 
 	if (v == NULL || path == NULL)
 		return NULL;
@@ -256,8 +257,13 @@ vhost_fastcgi(struct vhost *v, const char *path)
 		if (loc->fcgi != -1)
 			if (matches(loc->match, path))
 				return loc;
+		if (loc->nofcgi && matches(loc->match, path))
+			force_disable = 1;
 	}
 
+	if (force_disable)
+		return NULL;
+
 	loc = TAILQ_FIRST(&v->locations);
 	return loc->fcgi == -1 ? NULL : loc;
 }