我在AWS Elastic beantalk中有一个Django应用。目前,我正在尝试在环境中设置SSL。设置以下配置后,http和https均失败。我正在关注以下教程
https://github.com/lucasdf/demo-lets-encrypt-elastic-beanstalk/blob/master/ssl.config
SSL.conf:
LoadModule wsgi_module modules/mod_wsgi.so
WSGIPythonHome /opt/python/run/baselinenv
WSGISocketPrefix run/wsgi
WSGIRestrictEmbedded On
Listen 443
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile "/etc/letsencrypt/live/xxx/fullchain.pem"
SSLCertificateKeyFile "/etc/letsencrypt/live/xxx/privkey.pem"
Alias /static/ /opt/python/current/app/static/
<Directory /opt/python/current/app/static>
Order allow,deny
Allow from all
</Directory>
WSGIScriptAlias / /opt/python/current/app/xxx/wsgi/__init__.py
<Directory /opt/python/current/app>
Require all granted
</Directory>
WSGIDaemonProcess wsgi-ssl processes=1 threads=15 display-name=%{GROUP} \
python-path=/opt/python/current/app:/opt/python/run/venv/lib/python3.6/site-packages:/opt/python/run/venv/lib64/python3.6/site-packages \
home=/opt/python/current/app \
user=wsgi \
group=wsgi
WSGIProcessGroup wsgi-ssl
</VirtualHost>
<VirtualHost *:80>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost> ```