Newbie config not working..

Maxim Dounin mdounin at mdounin.ru
Fri Dec 18 01:22:33 MSK 2009


Hello!

On Thu, Dec 17, 2009 at 02:58:41PM -0500, mystique wrote:

[...]

>     66		location /wiki/ {
>     67			alias /usr/local/www/dokuwiki/;
>     68			include 	php_fastcgi_support;
>     69			index		doku.php;
>     70		}

[...]

> php_fastcgi_support:
> 
>      1		location ~ \.php$ {
>      2			fastcgi_pass   127.0.0.1:9000;
>      3			fastcgi_index  index.php;
>      4			fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
>      5			include        fastcgi_params;
>      6		}
> 
> 
> going to http://www.domain.org/ shows the wordpress site like it should and wp-admin and the likes all seem to work (wonderful)
> 
> The part that is not working as desired is the ssl portion.
> 
> going to https://secure.domain.org works as intended; which is rendering the contents of /usr/local/www/data trying to get to https://secure.domain.org/wiki/(index.php) does not work at all.

You have no root defined for location /wiki/.  You use alias 
instead, but alias a) isn't inherited into nested location you use 
to handle .php files and b) doesn't affect $document_root variable 
anyway.  So

    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

uses default root while resolving $document_root, which isn't likely 
what you want.

Try this instead:

    location /wiki/ {
        alias /usr/local/www/dokuwiki/;
        index doku.php;

        location ~ ^/wiki(.*\.php)$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_param  SCRIPT_FILENAME  /usr/local/www/dokuwiki$1;
            include        fastcgi_params;

        }
    }

Maxim Dounin



More information about the nginx mailing list