Welcome! Log In Create A New Profile

Advanced

Re: $fastcgi_script_name set incorrectly with alias directive

August 28, 2011 05:06PM
Alias does not change document root so that variable is going to be whatever the document root is. Not what the alias is

On Aug 28, 2011, at 12:57 PM, Dick Middleton <dick@fouter.net> wrote:

> 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
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

$fastcgi_script_name set incorrectly with alias directive

Dick Middleton August 28, 2011 03:58PM

Re: $fastcgi_script_name set incorrectly with alias directive

mike August 28, 2011 05:06PM

Re: $fastcgi_script_name set incorrectly with alias directive

Dick Middleton August 28, 2011 05:48PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 242
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready