I have my domain setup to host roundcube at the root domain just fine, using root /www/roundcube in the vhost config, but when I attempt to add another location for phpmyadmin using root /www/phpmyadmin for the location specific root I've been getting some odd errors. I've tried many different configurations, including alias, root, root with rewrite, etc, but I keep getting either 404, 403, just an empty screen (no source) or even it showing me the roundcube install from domain.com/phpmyadmin. Here is a pastebin of my vhost file as it stands now, where the phpmyadmin sub directory works, but the roundcube on the root domain doesn't. (I am on mobile at the moment so this was the best I could do)

What am I doing wrong, or better yet, which part of location/root/alias am I misunderstanding?

My vhost config file

1 Answer 1


When you add another root parameter in nginx, it treats that as the literal root for that specific location. For example:

location ^~ /phpmyadmin {
    root /www/phpmyadmin;

When you request /phpmyadmin nginx attempts to load /www/phpmyadmin/phpmyadmin.

A way that would work would be:

location ^~ /phpmyadmin {
    root /www;

Note that someone could not browse other directories other than /www/phpmyadmin since nginx only uses /www as the root when the location begins with /phpmyadmin.

If you still have issues, make sure that you are requesting index.php by including index index.php; in your location block. Also be sure to check your nginx error log for more information.

  • Ok, I fixed the root for the /phpmyadmin location and added the index directive, it then showed me the php file in plain text, so I added a "sublocation" to the phpmyadmin location to handle the php files based on some googling after your comment, and now it just returns a blank page. The error logs are not showing any errors.
    – Greg
    Commented Oct 25, 2016 at 17:50
  • 1
    Check your php processor's logs. More than likely it will be a PHP fatal error causing that blank page.
    – JorgenPhi
    Commented Oct 25, 2016 at 18:09
  • Php5-Fpm logs not showing anything than started, running (with pid), system monitor interval and that the configuration file has passed. However, thanks to your comments I did some digging and found that for some reason I have two sets of log files for my server. The one that I just found was giving me a "Primary script unknown" error, which led me to find that it is usually caused by a bad SCRIPT_FILENAME configuration, and that led me to find the new suggested fastcgi-php.conf file to replace the fastcgi_params file, and badd-bing-badda-boom, it seems to work now. Thank you for helping!
    – Greg
    Commented Oct 25, 2016 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.