我的服务器运行Django + Gunicorn + nginx.
我添加了SSL证书并配置了nginx以将http重定向到https.当收到https请求时,nginx将其作为http传递给Gunicorn.
我的程序有时返回HttpResponseRedirect,浏览器获得重定向响应并重新请求为http,因此nginx重定向到https.
HttpResponseRedirect
我怎么能避免这个?如何配置服务器以使第一个重定向直接指向https URL?
django https redirect nginx
django ×1
https ×1
nginx ×1
redirect ×1