小编per*_*ike的帖子

Django的HttpResponseRedirect是http而不是https

我的服务器运行Django + Gunicorn + nginx.

我添加了SSL证书并配置了nginx以将http重定向到https.当收到https请求时,nginx将其作为http传递给Gunicorn.

我的程序有时返回HttpResponseRedirect,浏览器获得重定向响应并重新请求为http,因此nginx重定向到https.

我怎么能避免这个?如何配置服务器以使第一个重定向直接指向https URL?

django https redirect nginx

9
推荐指数
1
解决办法
2908
查看次数

标签 统计

django ×1

https ×1

nginx ×1

redirect ×1