通过HTTPS访问网站正在断开数据库连接


Accessing web site by HTTPS is breaking database connection

我有一个运行在Apache web服务器上的代码点火器站点我从letsencrypt 安装了SSL

如果我通过http://example.com

但是,

如果我通过访问https://example.com站点显示,但数据库已损坏

这是我的htaccess文件

Include /etc/phpmyadmin/apache.conf
<VirtualHost *:80>
        ServerName example.org
        ServerAlias www.example.org
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        RewriteEngine on
        RewriteRule   "^/resources/(.+)" "https://example.org/_resources/$1"$
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        <Directory /var/www/html>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
        ProxyPass /api https://localhost:8010/api
        ProxyPassReverse /api https://localhost:8010/api
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerName example.org
    ServerAlias www.example.org
    DocumentRoot /var/www/html/
    Include /etc/letsencrypt/options-ssl-apache.conf
    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/example.org-0001/cert.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/example.org-0001/privkey.pem
    SSLCertificateChainFile /etc/letsencrypt/live/example.org-0001/chain.pem
</VirtualHost>

通过添加<VirtualHost *:443>标签内部修复了此问题

  <Directory /var/www/html>
        AllowOverride All 
  </Directory>