secure phpmyadmin nginx
[root@localhost conf.d]# pwd
/etc/nginx/conf.d
[root@localhost conf.d]# ls
phpmyadmin.inc phppgadmin.inc status.conf vesta.conf webmail.inc
[root@localhost conf.d]# cat phpmyadmin.inc
location /phpmyadmin {
alias /usr/share/phpMyAdmin;
allow 192.0.2.142;
allow 192.168.1.0/24;
deny all;
location ~ /(libraries|setup) {
return 404;
}
location ~ ^/phpmyadmin/(.*\.php)$ {
alias /usr/share/phpMyAdmin/$1;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
alias /usr/share/phpMyAdmin/$1;
}
}
Nginx
- Connect to the server with ISPmanager via SSH.
- Open the phpMyAdmin configuration file /etc/nginx/vhosts-includes/phpmyadmin.conf.
Add the following strings to the location /phpmyadmin section
CODENote
For the authentication settings to work correctly, add the IP address of the control panel to the list of permitted IP addresses.
Comments
Post a Comment