Apache server error 500 related to ssl

Hi,

My site was working just fine, and then it stopped for reasons I don’t know. I get a Server Error 500. I believe it’s related to SSL, because in most browsers I get that error, but in Brave it goes to http and works fine (as http). My site log lists no errors, and I don’t see any in the apache logs either.

The relevant settings.py:

secure proxy SSL header and secure cookies

SECURE_PROXY_SSL_HEADER = (‘HTTP_X_FORWARDED_PROTO’, ‘https’)
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True

session expire at browser close

SESSION_EXPIRE_AT_BROWSER_CLOSE = True

wsgi scheme

os.environ[‘wsgi.url_scheme’] = ‘https’

and wsgi.py:

os.environ[‘HTTPS’] = “on”

and in my apache 000-default_ssl.conf:

SSL section

SSLEngine on
SSLCertificateFile /etc/ssl/certs/mysite.crt
SSLCertificateKeyFile /etc/ssl/private/mysite.key

and lastly, in the 000-default.conf I have:

RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]

I could really use some help. Thanks.