So to help prevent brute force attacks against my phpmyadmin install I've configured nginx to require HTTP Basic Auth (extra username and password) and then the requests need to come from a whitelisted IP Address. However the IP Address whitelist works fine if I run https://example.com/phpmyadmin/ however without adding the extra .php block I could load https://example.com/phpmyadmin/index.php without my IP being whitelisted. This issue doesn't affect the HTTP Basic Auth. Is there a reason this happens? Anyway to get around having to add extra .php blocks? A copy of the config area for phpmyadmin is below.
# Setup and secure phpMyAdmin
location /phpmyadmin/ {
allow 1.2.3.4;
deny all;
auth_basic "phpMyAdmin - HTTP Basic Login";
auth_basic_user_file /etc/nginx/pma_pass;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
allow 1.2.3.4;
deny all;
}
}