From 4e10c31fe8307f0e532eb2783dfad299029df11f Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Thu, 19 Aug 2010 13:52:09 -0400 Subject: [PATCH] Add HTTPServer(..., xheaders=True) to the web documentation. --- website/templates/documentation.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/website/templates/documentation.txt b/website/templates/documentation.txt index 5e8fc49d..1efe791e 100644 --- a/website/templates/documentation.txt +++ b/website/templates/documentation.txt @@ -753,6 +753,11 @@ and static file server. We run multiple instances of the Tornado web server on multiple frontend machines. We typically run one Tornado frontend per core on the machine (sometimes more depending on utilization). +When running behind a load balancer like nginx, it is recommended to pass +`xheaders=True` to the `HTTPServer` constructor. This will tell Tornado +to use headers like `X-Real-IP` to get the user's IP address instead of +attributing all traffic to the balancer's IP address. + This is a barebones nginx config file that is structurally similar to the one we use at FriendFeed. It assumes nginx and the Tornado servers are running on the same machine, and the four Tornado servers