osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug 62477] New: ProxyPassInterpolateEnv causes config syntax failures at startup


https://bz.apache.org/bugzilla/show_bug.cgi?id=62477

            Bug ID: 62477
           Summary: ProxyPassInterpolateEnv causes config syntax failures
                    at startup
           Product: Apache httpd-2
           Version: 2.5-HEAD
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_proxy
          Assignee: bugs@xxxxxxxxxxxxxxxx
          Reporter: toscano.luca@xxxxxxxxx
  Target Milestone: ---

While playing with the following config (in httpd trunk) I got:

ProxyPassInterpolateEnv On
SetEnvIf "Test" "bla" proxy_port=8000

<Location /test>
     ProxyPass "http://localhost:${proxy_port}/test"; interpolate
</Location>

[Thu Jun 21 08:11:29.304425 2018] [core:warn] [pid 21013:tid 140441193370688]
AH00111: Config variable ${proxy_port} is not defined
AH00526: Syntax error on line 224 of /usr/local/apache2/conf/httpd.conf:
ProxyPass Unable to parse URL: http://localhost:${proxy_port}/test
httpd: abnormal exit 1

But if I move the ${proxy_port} outside scheme://host:port then httpd starts up
as expected.

https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypass says:

"""
The optional interpolate keyword, in combination with ProxyPassInterpolateEnv,
causes the ProxyPass to interpolate environment variables, using the syntax
${VARNAME}. Note that many of the standard CGI-derived environment variables
will not exist when this interpolation happens, so you may still have to resort
to mod_rewrite for complex rules. Also note that interpolation is not supported
within the scheme portion of a URL. Dynamic determination of the scheme can be
accomplished with mod_rewrite as in the following example.
"""

Didn't check in the code why this is the behavior, but either the code or the
docs are a bit misleading/wrong.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: bugs-help@xxxxxxxxxxxxxxxx