Django Book 翻译
菜单>:
TOC
返回
原文:
High-traffic sites often need to deploy Django behind a load-balancing proxy (see Chapter 20). This can cause a few small complications, one of which is that every requests remote IP (``request.META["REMOTE_IP"]`` ) will be that of the load balancer, not the actual IP making the request. Load balancers deal with this by setting a special header, ``X-Forwarded-For`` , to the actual requesting IP address.
翻译:
高流量的站点通常需要将Django部署在负载平衡proxy(参见第20章)之后。这种方式将带来一些复杂性,其一就是每个request中的远程IP地址(``request.META["REMOTE_IP"]``)将指向该负载平衡proxy,而不是发起这个request的实际IP。负载平衡proxy处理这个问题的方法在特殊的 ``X-Forwarded-For`` 中设置实际发起请求的IP。
备注:
译者: