Configuration phpmyadmin nginx error bad server - https://cloudwafer.com/blog/installing-phpmyadmin-with-nginx-on-centos-8/
sudo cp -pr /usr/share/phpMyAdmin/config.sample.inc.php /usr/share/phpMyAdmin/config.inc.php
sudo nano /usr/share/phpMyAdmin/config.inc.php
Next, Import the create_tables.sql
to create new tables for phpMyAdmin.
mysql < /usr/share/phpMyAdmin/sql/create_tables.sql -u root -p
sudo nano /etc/nginx/conf.d/phpMyAdmin.conf
server { listen 80; server_name phpmyadmin.cloudwaferlabs.com; root /usr/share/phpMyAdmin; location / { index index.php; } ## Images and static content is treated different location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ { access_log off; expires 30d; } location ~ /\.ht { deny all; } location ~ /(libraries|setup/frames|setup/libs) { deny all; return 404; } location ~ \.php$ { include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/phpMyAdmin$fastcgi_script_name; } }
nginx 2 config
location /phpmyadmin {
auth_basic "Admin Login";
auth_basic_user_file /etc/nginx/pma_pass;
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass unix:/var/run/php-fpm/www.sock; # or 127.0.0.1:9000
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
Comments
Post a Comment