Configuring phpMyAdmin with nginx (Fedora 17) for access at localhost/phpmyadmin
For your 404
, you should make the character cases match either all phpmyadmin
(all lower case) or phpMyAdmin
.
To make the config clearer (my opinion), you could use nested location
s:
location /phpmyadmin/ {
index index.php index.html index.htm;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/$uri;
include fastcgi_params;
}
}
You then have to relink phpMyAdmin
in your webroot (note the missing alias
directive):
unlink /usr/share/nginx/html/phpMyAdmin
ln -s /usr/share/phpMyAdmin /usr/share/nginx/html/phpmyadmin
Alternatively, to keep the mixed-case link, add this line to the above
location /phpmyadmin
to internally change the $uri
(required to find the files):
rewrite ^/phpmyadmin(.*)$ /phpMyAdmin$1;
To fix the
500
, you might want to check out another answer on SF about PHP restrictions. I just now realized that executing PHP scripts outside the webroot can trigger security mechanisms.That would then be a PHP error, meaning that the
location
matches.