Here is my phpmyadmin config file:
server {
listen 8080;
server_name phpmyadmin;
access_log /var/log/nginx/phpmyadmin.access.log;
error_log /var/log/nginx/phpmyadmin.error_log warn;
root /var/www/phpmyadmin;
index index.php index.htm;
location ~ \.php {
include /etc/nginx/fastcgi_params;
keepalive_timeout 0;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
}
}
Right now when I go to http://domain.com:8080
it brings up the phpmysdmin site. I want it to only open phpmyadmin if I go to http://domain.com:8080/phpmyadmin
. What change do I need to make here?
I have about 4 or 5 apps that I am going to run from nginx, and I'd prefer to keep each one in it's own sites-enabled
profile, instead of one big config file that covers them all.
a little bit more verbose:
also note the root setting: it's relative to request path, not whatever comes after that. So a request of http://phpmyadmin/phpmyadmin/index.php will make nginx try to find the file in $root/phpmyadmin/index.php where the $root is root path set in the location block.
Use location: