环境
- Ubuntu-16.04
- Nginx
- Django 1.11.20
问题
首先配置nginx 服务器https访问: 将nginx上运行的http访问的网站改造成https访问
之后在访问后端Django拿数据的时候产生问题:
[23/Sep/2019 17:06:04] You’re accessing the development server over HTTPS, but it only supports HTTP.`
解决
这里的命令改成了:
$ python manage.py runsslserver --certificate /root/root.crt --key /root/root.key 0.0.0.0:8000
然后前端写请求协议全改成https,数据正常访问。
