我刚刚在我的网站上安装了SSL证书.不幸的是,它破坏了登录功能.在网站上提交登录表单后,它只会重定向到主页.检查rails日志会显示以下错误:
(https://example.com) didn't match request.base_url (http://example.com)
这是我的virtualhosts文件.我想我需要以某种方式强制使用SSL?
<VirtualHost *:80> ServerName example.com ServerAlias www.example.com Redirect permanent / https://example.com/ </VirtualHost> <VirtualHost *:443> ServerAdmin hello@example.com ServerName example.com ServerAlias www.example.com SSLEngine on SSLCertificateFile /home/user/sharetribe/lib/certificates/www_example_com.crt SSLCertificateKeyFile /home/user/sharetribe/lib/certificates/example.com.key SSLCertificateChainFile /home/user/sharetribe/lib/certificates/www_example_com.ca-bundle ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass / http://localhost:3000/ ProxyPassReverse / http://localhost:3000/ </VirtualHost>