httpd icon indicating copy to clipboard operation
httpd copied to clipboard

mod_proxy_html filter's ProxyHTMLURLMap environment variables interpolation caused startup warnings

Open sgreiner opened this issue 1 year ago • 5 comments

mod_proxy_html filter's ProxyHTMLURLMap environment variables interpolation causes startup warnings.

It used v2.2 ${var} notation style to reference environment variables instead of v2.4 notation style %{ENV:var} (like mod_rewrite syntax)

So it correctly caused startup warnings like "AH00111: Config variable ${var} is not defined" because, under v2.4, the ${var} syntax is reserved for variables defined by a DEFINE directive or for environment variables existing before the server was started.

See:

  • https://httpd.apache.org/docs/2.4/en/configuring.html
  • https://bz.apache.org/bugzilla/show_bug.cgi?id=58467

Before:

RewriteRule ^/path/(foo|bar)/(.*)$ - [E=mypath:$1]
<LocationMatch "/path/(foo|bar)/.*">
	SetOutputFilter proxy-html
	ProxyHTMLInterp On
	ProxyHTMLURLMap ^/a/path/to/change/(.*)$ /newpath/${mypath}/images/$1 ecRiLV
</LocationMatch>

After:

RewriteRule ^/path/(foo|bar)/(.*)$ - [E=mypath:$1]
<LocationMatch "/path/(foo|bar)/.*">
	SetOutputFilter proxy-html
	ProxyHTMLInterp On
	ProxyHTMLURLMap ^/a/path/to/change/(.*)$ /newpath/%{ENV:mypath}/images/$1 ecRiLV
</LocationMatch>

This might be a breaking change for people who used to live with the startup warning.

Thank you for considering the change.

sgreiner avatar May 03 '23 18:05 sgreiner