nginx alias+location-Direktive

server {
    listen      80;
    server_name  pwta; 
    root html;

    location /test/{
        alias html/test/;
        autoindex on;
    }
    location ~ \.php$ {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
}

Diese Konfiguration funktioniert. Allerdings, wenn location /test/ ersetzt wird, z.B. location /testpath/ es funktioniert nicht (Keine Eingabedatei angegeben). Ich nahm an, auf der Basis der Erklärung von alias-Direktive, die "location" - Teil gefallen ist und somit /testpath/info.php führen würde html/test/info.php.

Vielen Dank für jede Anregung.

InformationsquelleAutor Allfo | 2012-04-10
Schreibe einen Kommentar