centos 7 nginx phpmyadmin“无法识别的内容安全策略指令'Referer.”

toe95027  于 2021-09-29  发布在  Java
关注(0)|答案(0)|浏览(281)

我有一个Web服务器,我使用phpmyadmin从中管理mysql数据库。它远程连接到数据库所在的rds。它已经安装并运行了一年多。我将其设置为导航到特定目录,类似于“https://example.com/test".
最近从php7.2升级到7.4后,它现在出现错误“无法识别的内容安全策略指令‘referer’”,并拒绝连接到mysql服务器,而是重定向到https://example.com/test/index.php“这又是登录页面。
当我尝试登录mysql服务器时是什么样子的
我对phpmyadmin上的初始服务器有以下配置。河豚的秘密、主机和端口已被审查,但与工作时相比没有更改。我将其他大多数选项保留为默认选项。

  1. $cfg['blowfish_secret'] = '***********************'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
  2. $i = 0;
  3. $i++;
  4. $cfg['Servers'][$i]['verbose'] = 'RDS';
  5. $cfg['Servers'][$i]['host'] = '*****************************';
  6. $cfg['Servers'][$i]['port'] = '****';
  7. $cfg['Servers'][$i]['socket'] = '';
  8. $cfg['Servers'][$i]['connect_type'] = 'tcp';
  9. $cfg['Servers'][$i]['extension'] = 'mysqli';
  10. $cfg['Servers'][$i]['compress'] = FALSE;
  11. $cfg['Servers'][$i]['controluser'] = '';
  12. $cfg['Servers'][$i]['controlpass'] = '';
  13. $cfg['Servers'][$i]['auth_type'] = 'cookie';
  14. $cfg['Servers'][$i]['user'] = '';
  15. $cfg['Servers'][$i]['password'] = '';
  16. $cfg['Servers'][$i]['only_db'] = '';
  17. $cfg['Servers'][$i]['hide_db'] = '';
  18. $cfg['Servers'][$i]['pmadb'] = '';
  19. $cfg['Servers'][$i]['bookmarktable'] = '';
  20. $cfg['Servers'][$i]['relation'] = '';
  21. $cfg['Servers'][$i]['table_info'] = '';
  22. $cfg['Servers'][$i]['table_coords'] = '';
  23. $cfg['Servers'][$i]['pdf_pages'] = '';
  24. $cfg['Servers'][$i]['column_info'] = '';
  25. $cfg['Servers'][$i]['history'] = '';
  26. $cfg['Servers'][$i]['verbose_check'] = TRUE;
  27. $cfg['Servers'][$i]['AllowRoot'] = TRUE;
  28. $cfg['Servers'][$i]['AllowDeny']['order'] = '';
  29. $cfg['Servers'][$i]['AllowDeny']['rules'] = array();
  30. $cfg['Servers'][$i]['AllowNoPassword'] = FALSE;
  31. $cfg['Servers'][$i]['designer_coords'] = '';
  32. $cfg['Servers'][$i]['bs_garbage_threshold'] = 50; // DEFAULT: '50'
  33. $cfg['Servers'][$i]['bs_repository_threshold'] = '32M'; // DEFAULT: '32M'
  34. $cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600; // DEFAULT: '600'
  35. $cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M'; // DEFAULT: '32M'

我还有一个nginx代码段的以下配置,它包含在我特定网站的nginx conf文件中。我将目录替换为“test”,它有一个软链接“ln-s/usr/share/phpmyadmin/var/www/html/test”。

  1. location /test {
  2. root /var/www/html;
  3. index index.php index.html index.htm;
  4. location ~ ^/test/(.+\.php)$ {
  5. try_files $uri =404;
  6. root /var/www/html;
  7. fastcgi_pass 127.0.0.1:9000;
  8. fastcgi_index index.php;
  9. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  10. include /etc/nginx/fastcgi_params;
  11. }
  12. location ~* ^/test/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
  13. root /var/www/html;
  14. }
  15. }
  16. #location /test {
  17. # rewrite ^/* /test last;
  18. #}

文件夹/etc/phpmyadmin及其内容的权限已设置为nginx。
我可以提供任何其他信息,但我尝试了多项更改,包括:
通过“proxy\u set\u header”在nginx中将referer设置为no referer
在phpmyadmin a的头文件中从php本身删除它
完全删除并重新安装phpmyadmin,但未成功。
我发现的所有与“referer”错误相关的在线信息都在谈论刷新缓存,在这种情况下,它不会做任何事情,在多个浏览器上测试。我还尝试过在phpmyadmin上更改为config并输入用户名和密码的建议,它会给出相同的referer错误以及一个完全锁定登录页面的无效设置错误。
我无法判断引用错误是否阻止登录mysql服务器,或者这只是问题的一部分。我一定是遗漏了一些关于phpmyadmin如何使用csp的关键信息,或者nginx配置中出现了一些错误?我错过了什么?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题