错误:java.sql.SQLException: null, message from server: "Host '8.130.99.127' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'"
问题产生场景
使用宝塔面板和阿里云服务器部署前后端分离项目
nginx配置
server {
listen 8081;
server_name 8.130.99.127;
location / {
root /www/Blog/dist; #你打包项目存放的位置
try_files $uri $uri/ @router; #检测文件存在性重定向到首页目录 防止404
index index.html;
}
location @router {
rewrite ^.*$ /index.html last;
}
location /myRoute/ {
alias /www/Blog/dist;
try_files $uri $uri/ @router;
}
location /api/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header Access-Control-Allow-Methods *;
add_header Access-Control-Allow-Origin $http_origin;
proxy_pass http://8.130.99.127:8088/; #请求转向定义的服务器
}
}
前端项目访问http://8.130.99.127/8081
能够成功访问网站首页,然后点击登录无响应,查看后台服务日志,出现上述错误,第一次部署项目,人快麻了.