add `fastcgi off' to forceful skip fastcgi for a route

This commit is contained in:
Omar Polo 2023-07-23 19:04:37 +00:00
parent fdd67729b4
commit 6a8387e5f5
4 changed files with 13 additions and 0 deletions

View File

@ -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

1
gmid.h
View File

@ -175,6 +175,7 @@ struct location {
X509_STORE *reqca;
int disable_log;
int fcgi;
int nofcgi;
struct envhead params;
char dir[PATH_MAX];

View File

@ -491,6 +491,10 @@ locopt : AUTO INDEX bool { loc->auto_index = $3 ? 1 : -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.");

View File

@ -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;
}