$fastcgi_script_name set incorrectly with alias directive

Hi,

I having trouble getting alias directive to work as I would expect.
One
thing I find is that the location part of the request is not being
dropped in
the $fastcgi_script_name.

Here’s my location block

   location /mydnsadmin {
      alias /var/www/lingbrae.ssl/usr;
      index mydns.php;
      include includes/php-alt.inc;
   }

I initially set the SCRIPT_FILENAME to $request_filename which is
computed
correctly but later I reset it to $document_root$fastcgi_script_name
but is incorrect.

Here’s the debug:

*840 http script copy: “SCRIPT_FILENAME”
*840 http script var: “/var/www/lingbrae.ssl/usr/mydns.php” <— this
is
$request_filename
*840 fastcgi param: “SCRIPT_FILENAME:
/var/www/lingbrae.ssl/usr/mydns.php”
<–correct
*840 http script copy: “SCRIPT_NAME”
*840 http script var: “/mydnsadmin/mydns.php”
*840 fastcgi param: “SCRIPT_NAME: /mydnsadmin/mydns.php”
*840 http script copy: “REQUEST_URI”
*840 http script var: “/mydnsadmin/”
*840 fastcgi param: “REQUEST_URI: /mydnsadmin/”
*840 http script copy: “DOCUMENT_URI”
*840 http script var: “/mydnsadmin/mydns.php”
*840 fastcgi param: “DOCUMENT_URI: /mydnsadmin/mydns.php”
*840 http script copy: “DOCUMENT_ROOT”
*840 http script var: “/var/www/lingbrae.ssl/usr”
*840 fastcgi param: “DOCUMENT_ROOT: /var/www/lingbrae.ssl/usr”

*840 fastcgi param: “REDIRECT_STATUS: 200”
*840 http script copy: “SCRIPT_FILENAME”
*840 http script var: “/var/www/lingbrae.ssl/usr” <-- This is
$document_root
*840 http script var: “/mydnsadmin/mydns.php” <— this is
$fastcgi_script_name (notice location is not stripped)
*840 fastcgi param: “SCRIPT_FILENAME:
/var/www/lingbrae.ssl/usr/mydnsadmin/mydns.php” <— incorrect

Am I supposed to set the fastcgi params differently if I use the alias
directive or is this a problem with alias.

Dick

Alias does not change document root so that variable is going to be
whatever the document root is. Not what the alias is

On 08/28/11 21:47, Michael S. wrote:

Alias does not change document root so that variable is going to be whatever the
document root is. Not what the alias is

Hmm, document_root is set, as I would expect, to alias value. It’s the
script
name (document_uri) which, to me, is wrong.

What’s really puzzling is that request_filename is ‘correct’. That’s a
sentiment I expressed in May when:

On 05/25/11 13:48, Igor S. wrote:

$request_filename is “$document_root$uri”.

Apparently not always :slight_smile:

Dick