Allow PHPMyAdmin access on certain virtual hosts - Ubuntu and Nginx

Francis Daly francis at daoine.org
Fri Oct 7 13:33:19 UTC 2016


On Thu, Oct 06, 2016 at 06:07:51PM -0400, mrast wrote:

Hi there,

> I have installed phpmyadmin and configured it and it works fine, however it
> serves all 4 websites.
> 
> website1 and website3 do not need access to phpmyadmin.
> 
> How do i tell Nginx to only load phpmyadmin for certian websites please?

Look at your config for the server{} block for website1.

Find the piece that relates to phpmyadmin.

Remove it.


The server{} block is identified by "server_name" including "website1".

You can "find the piece" by looking at the "location" blocks that are
defined, and learning one request that makes use of phpmyadmin, and seeing
which one "location" handles that request -- http://nginx.org/r/location
for details.


If it turns out that you only have one server{} block for all four
websites, then it is probably simplest to copy-and-change it to two
or four different blocks with different "server_name" values, and then
remove the phpmyadmin part from the website1 and website3 block or blocks.

Good luck with it,

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list