C
C
CaptainJustness2021-10-30 21:05:13
Nginx
CaptainJustness, 2021-10-30 21:05:13

How to hide phpMyAdmin from all sites except the main host on Ubuntu (apache + nginx)?

Hello.

Now phpMyAdmin is available from all domains. How to make it open only from the server IP? For example: 1.2.3.4/phpmyadmin
Settings are needed for apache and nginx config. Please write clear instructions. Where to transfer the config, where to make it empty, etc.

Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Dmitriev, 2021-10-30
@SignFinder

Remove the conf file for phpmyadmin from the directory that is included to the apache configuration files and therefore affects all domains and manually write the path to the file through include in the configuration file of a specific domain

A
AUser0, 2021-10-31
@AUser0

Do you all server{} point to one common directory, in which phpMyAdmin is also lying around? Then do at least

location /phpMyAdmin/ {
if ($host != "1.2.3.4") {
return 444;
}
allow 1.2.3.4;
allow 55.66.77.88;
deny all;
}

And so - in each server{...}.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question