You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2017/09/14 03:22:26 UTC
[Bug 61518] New: environment variables set or changed in virtual
hosts are not available in .htaccess
https://bz.apache.org/bugzilla/show_bug.cgi?id=61518
Bug ID: 61518
Summary: environment variables set or changed in virtual hosts
are not available in .htaccess
Product: Apache httpd-2
Version: 2.5-HEAD
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: mod_setenvif
Assignee: bugs@httpd.apache.org
Reporter: developerchris@rebel.com.au
Target Milestone: ---
In a firewalled environment it is often necessary to configure your firewall to
terminate SSL and to proxy via http to the internal server.
To ensure the creation of valid links it is necessary to fool the running
software on the internal server that it is on ssl. thus links etc are created
correctly.
To enable the process it is common for there to be a config line in your
virtual server like the following
# reverse proxy server that sets the "X-Forwarded-Proto https" flag
SetEnvIfNoCase X-Forwarded-Proto https HTTPS=on
Unfortunately it appears that the the environment variable set in the virtual
host is not honoured in the .htaccess processing stage.
Therefore as an example this snippet of code fails
# if you enable "www." stripping or enforcement, in order to ensure that
# you don't bounce between http and https.
RewriteRule ^ - [E=protossl]
RewriteCond %{HTTPS} on
RewriteRule ^ - [E=protossl:s]
The above code is taken from a Drupal 8 .htaccess file
I would expect that any environment variables set or replaced in the virtual
server section of the config to precede the .htaccess processing and therefore
the modified contents of the env be available.
This does not appear to be happening.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 61518] environment variables set or changed in virtual hosts
are not available in .htaccess
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61518
--- Comment #2 from developerchris@rebel.com.au ---
Then how does one influence this variable?
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 61518] environment variables set or changed in virtual hosts
are not available in .htaccess
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61518
Eric Covener <co...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
Status|NEW |RESOLVED
OS| |All
--- Comment #1 from Eric Covener <co...@gmail.com> ---
%{HTTPS} is not an environment variable lookup, so setting an
environment variable by the same name does not influence the rewriterule.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org