[Bug 61518] New: environment variables set or changed in virtual hosts are not available in .htaccess

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 61518] New: environment variables set or changed in virtual hosts are not available in .htaccess

Bugzilla from bugzilla@apache.org
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: [hidden email]
          Reporter: [hidden email]
  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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 61518] environment variables set or changed in virtual hosts are not available in .htaccess

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61518

Eric Covener <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED
                 OS|                            |All

--- Comment #1 from Eric Covener <[hidden email]> ---
%{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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 61518] environment variables set or changed in virtual hosts are not available in .htaccess

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61518

--- Comment #2 from [hidden email] ---

Then how does one influence this variable?

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]