Re: Directory Trailing Slash When Behind Load Balancer

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

 



On Tue, May 14, 2024 at 6:07 PM Gavin Spomer <Gavin.Spomer@xxxxxxx> wrote:
>
> Hello,
>
> I recently migrated my Apache web server from FreeBSD to Ubuntu Server and found an issue with URLs that point to a directory, but don't include the trailing slash, when going through our institution's load balancer. If I access directly (not going through the load balancer), everything works fine:
>
>    http://mywebserver.example.com/application
>
>    Above works as, from reading the mod_dir documentation, it redirects to
>    http://mywebserver.example.com/application/ (adds the trailing slash) and thus the application's index.php script
>    is executed.
>
> My web server is fronted by our institution's load balancer which does SSL termination and then sends the request to my web server on port 81. I am not seeing the same behavior when accessing through our load balancer:
>
>    https://loadbalancer.example.com/application
>
>    The above doesn't work. It hangs, times out and then redirects to http://loadbalancer.example.com:81/application/
>    with a "This site can’t be reached" message. It does work if I explicitly add the slash to the URL in my browser:

That's probably not the order that events are acutally happening. It
most likely redirects to
http://loadbalancer.example.com:81/application/ first.

[...]
> <VirtualHost *:81>
>    ServerName mywebserver.example.com:81

Redirects require a complete URL, and mod_dir is probably assembling
that using the ServerName. Use the developer tools in your browser or
curl -v to see what's actually going on, particularly the "Location:"
response header, which is the URL the redirect is sending your browser
to.

Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx





[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux