0

我放弃了...当我输入 url localhost/pma/ 时,如何配置 nginx 在 html/pma 文件夹中打开 inedx.php?

当我输入 localhost/pma/index.php 它的工作。我在窗户上工作。

我的 nginx 配置:

worker_processes  1;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;

    server {
        listen       80;
        server_name  localhost;

index  index.html index.htm index.php;

        location / {
            root   html;
            index  index.html index.htm index.php;
        }

        location /pma/ {
            root   html/pma;
            index  index.html index.htm index.php;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        location ~ \.php$ {
            include fastcgi.conf;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            include fastcgi_params;
        }

    }
}
4

1 回答 1

0

通过 irc 上的 Ray`n 解决:root 必须在服务器中,而不是位置。

worker_processes  1;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;

    server {
        listen       80;
        server_name  localhost;

index  index.html index.htm index.php;
root html

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        location ~ \.php$ {
            include fastcgi.conf;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            include fastcgi_params;
        }

    }
}
于 2013-01-21T19:21:10.687 回答