django - Django 在 HTTPS 上显示 500 内部服务器错误
问题描述
我error.log
在 apache2 目录中收到以下错误: Segmentation fault (11), possible coredump in /etc/apache2
.
我的配置中有以下配置example-instance.conf
:
ErrorDocument 404 "/error-pages/404.html"
ErrorDocument 500 "/error-pages/500.html"
ErrorDocument 403 "/error-pages/403.html"
# Change the following three lines for your server
ServerName example.app
SetEnv HTTP_HOST "example.app"
ServerAdmin admin@example.app
SetEnv LC_TIME "en_GB.UTF-8"
SetEnv LANG "en_US.UTF-8"
SSLEngine on
SSLCertificateFile "path/to/certificate"
SSLCertificateChainFile "path/to/certificate"
SSLCertificateKeyFile "path/to/private_key"
WSGIScriptAlias /app "path/to/wsgi_prod.py"
# Comment next 2 lines if using older Apache than v2.4
WSGIApplicationGroup %{GLOBAL}
WSGIDaemonProcess instance1_wsgi python-path="__PATH_TO_ENV_SITE-PACKAGES_FOLDER__"
WSGIProcessGroup instance1_wsgi
# Comment 'Require all granted' for older Apache than v2.4
<Location "/">
Require all granted
Options FollowSymLinks
</Location>
Alias /static/ "path/to/static/"
Alias /app/static/ "path/to/static/"
<Directory "path/to/static/">
Require all granted
Options -Indexes
</Directory>
Alias /data/ "path/to/data/"
<Directory "path/to/data/">
Require all granted
Options -Indexes
</Directory>
ErrorLog ${APACHE_LOG_DIR}/example-instance-error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/example-instance-access.log combined
该网站http
在配置它时运行得非常好https
,我正在进入500 Internal Server Error
我的 Django 应用程序所在的“/app”子目录。该网站的登录页面非常好,这表明它https
正在工作。
解决方案
我有同样的问题:/ 现在唯一的选择是关闭 mod_ssl 并返回配置文件中的端口 80。
奇怪的是我在 settings.py 中有 Debug = True 但是当应用程序崩溃时我只收到来自 apache 的错误 500 页面。
推荐阅读
- java - Viewmodel 无法创建类 Android Java MVVM 的实例
- cucumber - Wdio.conf:如何在 oncomplete 挂钩中使用结果对象
- cucm - 在 Cisco AXL CUCM 中获取所有没有过滤器的结果
- java - 重复ID错误膨胀片段,android
- java - 使用spring数据jpa存储库进行Hql查询后的flush()
- javascript - 反斜杠“\”后忽略字符 - javascript
- java - 使用 JVM 内存默认值运行 Java Web 应用程序
- android - Flutter 应用生命周期回调函数
- excel - 从不同工作表中的结构化表中返回下一个可见单元格的值
- apache - HTTP 状态 404 刷新后