Mobile app version of vmapp.org
Login or Join
Turnbaugh106

: Using nginx to host roundcube on root domain, while hosting phpmyadmin from sub directory I have my domain setup to host roundcube at the root domain just fine, using root /www/roundcube in

@Turnbaugh106

Posted in: #Configuration #Nginx #Vhost

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

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Turnbaugh106

1 Comments

Sorted by latest first Latest Oldest Best

 

@Correia994

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme