TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Nginx Load Balancing Basics

172 点作者 jimaek超过 12 年前

9 条评论

bigdubs超过 12 年前
Something that is pretty important, and is missing from this guide, is to make sure you add headers indicating what the original IP address for the requests were (either in x-forwarded-for or x-real-ip or something else common.)<p>Can do this in the root location "/" with:<p>proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<p>Also good to remember to put another header in for the forwarded protocol (if you're terminating an ssl tunnel at the balancer.)
评论 #5058982 未加载
评论 #5058525 未加载
评论 #5058077 未加载
cmer超过 12 年前
I'm really on the fence between Haproxy or Nginx. I have used Haproxy successfully in the past, but I'm tempted by the simplicity of Nginx, especially now that it supports SPDY.<p>Would like to hear people's thoughts on using Nginx in "real life" for load balancing rather than Haproxy.
评论 #5056742 未加载
评论 #5056755 未加载
评论 #5058686 未加载
评论 #5059516 未加载
评论 #5058205 未加载
adrianpike超过 12 年前
Another awesome thing - as of 1.3.1/1.2.2, nginx can do least connections load balancing, which is better if your upstream response time isn't very consistent.
mattparlane超过 12 年前
Another alternative is Hipache:<p><a href="https://github.com/dotcloud/hipache" rel="nofollow">https://github.com/dotcloud/hipache</a><p>It's based on NodeJS, and it's really good. I've been using it in front of three web servers serving around 800 small-to-medium business websites for the last six months and it's been fantastic.<p>It pull configuration data from Redis so you can easily do things like automating deployments etc.
ccarpenterg超过 12 年前
It would be nice to have a library for adding server/s to an upstream on the fly. Something like:<p>nginx addserver upstream-name 127.0.0.1:8025<p>EDIT: Added upstream name
评论 #5056521 未加载
评论 #5056351 未加载
评论 #5056146 未加载
评论 #5057692 未加载
moepstar超过 12 年前
That's really helpful &#38; nicely written - shouldn't that be added to the NGINX Wiki in some way (either as a complete how-to-do-this or just as a link)?
评论 #5056356 未加载
wtracy超过 12 年前
What does the syntax <i>server unix:/tmp/backend;</i> do? Does that serve from the local filesystem without going through another http daemon?
评论 #5055804 未加载
评论 #5055581 未加载
ftwinnovations超过 12 年前
Does anyone know of a quality basics guide for HAProxy?
评论 #5059532 未加载
chr15超过 12 年前
Can anyone compare Nginx and HAProxy, and also provide an example of using both in an infrastructure?
评论 #5058750 未加载
评论 #5065965 未加载