Will someone please help me understand why when I specify the full scheme in the ServerName directive verses just the FQDN it breaks just this one request?
ServerName [
example.com:443...]
-- verses --
ServerName example.com
Quote from ASF docs
"The ServerName directive sets the request scheme, hostname and port that the server uses to identify itself. This is used when creating redirection URLs....Sometimes, the server runs behind a device that processes SSL, such as a reverse proxy, load balancer or SSL offload appliance. When this is the case, specify the https:// scheme and the port number to which the clients connect in the ServerName directive to make sure that the server generates the correct self-referential URLs."
Problem Summary: Request http://example.com/PAGE redirection and protocol switch to longer true full uri works.
Request [
example.com...] returns a 404.
Here is my reduced configuration. I know it is duplication and the Redirect directive is a better choice. I'll deal with that in the June release. Also, I did testing with Redirect/RedirectMatch and same behaviors; however mod_rewrite gives me a look under-the-hood.
LOAD BALANCER
-------------
F5 Virtual Server (VIP:80) performing generic HTTP to Apache.
Member webserver1:8080
Member webserver2:8080
F5 Virtual Server (VIP:443) performing (SSL offloaded here) HTTPS to Apache.
Member webserver1:8443
Member webserver2:8443
HTTP Server
-----------
# HTTP container (
works)
<VirtualHost IP:8080>
ServerName http://example.com:80
RewriteRule ^/PAGE [
%{HTTP_HOST}...] [L]
<Location /full/uri/path/PAGE>
proxy junk
</Location>
</VirtualHost>
# HTTPS container (
error 404)
<VirtualHost IP:8443>
ServerName [
example.com:443...]
RewriteRule ^/PAGE [
%{HTTP_HOST}...] [L]
<Location /full/uri/path/PAGE>
proxy junk
</Location>
</VirtualHost>
Solution: # HTTPS container
without the full scheme works, I don't understand why?
<VirtualHost IP:8443>
ServerName example.com RewriteRule ^/PAGE [
%{HTTP_HOST}...] [R=302,L]
<Location /full/uri/path/PAGE>
proxy junk
</Location>
</VirtualHost>
rewrite.log snippet [
example.com...] without full scheme
------------
init rewrite engine with requested uri /PAGE
applying pattern '^/PAGE' to uri '/PAGE'
rewrite '/PAGE' -> 'https://example.com/full_uri/path/PAGE?action=displaylogin'
split uri=https://example.com/full_uri/path/PAGE?action=displaylogin -> uri=https://example.com/full_uri/path/PAGE, args=action=displaylogin
implicitly forcing redirect (rc=302) with [
example.com...]
escaping [
example.com...] for redirect
redirect to [
example.com...] [REDIRECT/302]
rewrite.log snippet [
example.com...] with full scheme
------------
init rewrite engine with requested uri /PAGE
applying pattern '^/PAGE' to uri '/PAGE'
rewrite '/PAGE' -> 'https://example.com/full_uri/path/PAGE?action=displaylogin'
split uri=https://example.com/full_uri/path/PAGE?action=displaylogin -> uri=https://example.com/full_uri/path/PAGE, args=action=displaylogin
reduce [
example.com...] -> /full_uri/path/PAGE
local path result: /full_uri/path/PAGE
prefixed with document_root to /docroot/full_uri/path/PAGE
go-ahead with /docroot/full_uri/path/PAGE [OK]
error_log: ... File does not exist: /docroot/full_uri/path
Of course 404, /full_uri/path is namespace <Location> not physical <Directory>. I don't understand why it is apparently internalizing the explicit redirection target.
Thanks in advance, David