| Description: | Allow variables sent to FastCGI servers to be fixed up |
| Syntax: | ProxyFCGISetEnvIf conditional-expression
- environment-variable-name
- value-expression |
+ [!]environment-variable-name
+ [value-expression]
| Context: | server config, virtual host, directory, .htaccess |
| Status: | Extension |
| Module: | mod_proxy_fcgi |
@@ -251,29 +251,53 @@ the condition expressions and value expressions.
Parameter syntax:
- conditional-expression
-- Specifies an expression that controls whether the environmen variable that
+
- Specifies an expression that controls whether the environment variable that
follows will be modified. For information on the expression syntax, see
the examples that follow or the full specification at the
ap_expr documentation.
- environment-variable-name
- Specifies the CGI environment variable to change,
- such as PATH_INFO.
+ such as PATH_INFO. If preceded by an exclamation point, the variable
+ will be unset.
- value-expression
-- Specifies the replacement value for the preceding environment variable. Backreferences, such as "$1",
-can be included from regular expression captures in conditional-expression
+- Specifies the replacement value for the preceding environment variable.
+ Backreferences, such as "$1", can be included from regular expression
+ captures in conditional-expression. If omitted, the variable is
+ set (or overridden) to an empty string — but see the Note below.
-
-# A basic, unconditional override
-ProxyFCGISetEnvIf "true" PATH_INFO "/example"
-
-# Use an environment variable in the value
-ProxyFCGISetEnvIf "true" PATH_INFO "%{reqenv:SCRIPT_NAME}"
-
-# Use captures in the conditions and backreferences in the replacement
-ProxyFCGISetEnvIf "reqenv('PATH_TRANSLATED') =~ m#(/.*prefix)(\d+)(.*)#" PATH_TRANSLATED "$1$3"
-
+# A basic, unconditional override
+ProxyFCGISetEnvIf "true" PATH_INFO "/example"
+
+# Use an environment variable in the value
+ProxyFCGISetEnvIf "true" PATH_INFO "%{reqenv:SCRIPT_NAME}"
+
+# Use captures in the conditions and backreferences in the replacement
+ProxyFCGISetEnvIf "reqenv('PATH_TRANSLATED') =~ m|(/.*prefix)(\d+)(.*)|" PATH_TRANSLATED "$1$3"
+
+
+Note: Unset vs. Empty
+ The following will unset
VARIABLE, preventing it from being sent
+ to the FastCGI server:
+
+
ProxyFCGISetEnvIf true !VARIABLE
+
+
+ Whereas the following will erase any existing
value of
+
VARIABLE (by setting it to the empty string), but the empty
+
VARIABLE will still be sent to the server:
+
+
ProxyFCGISetEnvIf true VARIABLE
+
+
+ The CGI/1.1 specification
+
does not
+ distinguish between a variable with an empty value and a variable that
+ does not exist. However, many CGI and FastCGI implementations distinguish (or
+ allow scripts to distinguish) between the two. The choice of which to use is
+ dependent upon your implementation and your reason for modifying the variable.
+
diff --git a/docs/manual/mod/quickreference.html.en b/docs/manual/mod/quickreference.html.en
index b176e4ed9ff..c5a9c5a50e8 100644
--- a/docs/manual/mod/quickreference.html.en
+++ b/docs/manual/mod/quickreference.html.en
@@ -792,8 +792,8 @@ response
| ProxyExpressEnable [on|off] | | sv | E |
| Enable the module functionality. |
| ProxyFCGIBackendType FPM|GENERIC | FPM | svdh | E |
| Specify the type of backend FastCGI application |
| ProxyFCGISetEnvIf conditional-expression
- environment-variable-name
- value-expression | | svdh | E |
| Allow variables sent to FastCGI servers to be fixed up |
+ [!]environment-variable-name
+ [value-expression] | svdh | E | | Allow variables sent to FastCGI servers to be fixed up |
| ProxyFtpDirCharset character set | ISO-8859-1 | svd | E |
| Define the character set for proxied FTP listings |
| ProxyFtpEscapeWildcards [on|off] | | svd | E |
| Whether wildcards in requested filenames are escaped when sent to the FTP server |
| ProxyFtpListOnWildcard [on|off] | | svd | E |
| Whether wildcards in requested filenames trigger a file listing |