Nginx / phpmyadmin目录为默认主机

我对我的nginx服务器有问题。

我对nginx相当陌生,所以configuration文件不是我最强(还)

我在/etc/nginx/conf.d/中有这个default.conf:

server { listen 80; server_name _; #charset koi8-r; #access_log logs/host.access.log main; location / { root /usr/share/nginx/html; index index.php index.html index.htm; } error_page 404 /404.html; location = /404.html { root /usr/share/nginx/html; } # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { root /usr/share/nginx/html; try_files $uri =404; fastcgi_pass unix:/tmp/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # location ~ /\.ht { deny all; } location /phpMyAdmin { root /usr/share; index index.html index.htm index.php; } location ~ \.php$ { root /usr/share; try_files $uri =404; fastcgi_pass unix:/tmp/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } 

但是当我访问<ServerIP>/phpMyAdmin它只是给了我一个404。

日志文件是这样的:

 2012/09/18 19:12:53 [error] 3184#0: *1 open() "/usr/share/phpMyAdmin/nginx-logo.png" failed (2: No such file or directory), client: 1.2.3.4, server: _, request: "GET /phpMyAdmin/nginx-logo.png HTTP/1.1", host: "4.3.2.1", referrer: "http://4.3.2.1/phpMyAdmin/index.php" 

我做错了什么?

以下是我的configuration中的相关代码。 我努力做到这一点,我也是nginx的新手。

尝试将跟踪斜杠添加到位置部分的根声明的末尾。

 location /phpMyAdmin { root /usr/share/; index index.php index.html index.htm; location ~ ^/phpMyAdmin/(.+\.php)$ { try_files $uri =404; root /usr/share/; fastcgi_pass unix:/tmp/php-fpm.socket; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $request_filename; include fastcgi_params; fastcgi_param PATH_INFO $fastcgi_script_name; } location ~* ^/phpMyAdmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { root /usr/share/; } }