[nginx] load balancing & location
一
将NGINX配置成7层load balancer,该怎么做?
参见:
http://nginx.org/en/docs/http/load_balancing.html
https://docs.nginx.com/nginx/admin-guide/load-balancer/http-load-balancer/
https://www.nginx.com/blog/nginx-load-balance-deployment-models/?_ga=2.46277799.1689967697.1521711772-726225183.1521711772
二
其中,分发的一个关键节点是location关键字的值。
见location命令的描述:http://nginx.org/en/docs/http/ngx_http_core_module.html#location
摘要:
1. 描述方式:
a。 前缀字符串
b。 正则表达式
1 大小写敏感
2 大小写不敏感
2. 优先匹配顺序。
a。先检查前缀字符串。
1. 多个匹配的时候,最长的匹配前缀将被选中并记住。
2. 当选中的最长前缀由 ”^~“ 进行修饰的时候,将不再检查正则表达式。
b。 再检查正则表达式。
1. 按照配置文件中出现的前后顺序逐条检查,遇到第一条匹配时即停止。
2. 如果没有匹配到正则,之前记录下的最长前缀匹配将被使用。
3. 正则表达式支持capture
4. 精准匹配
使用 “=” 修饰,匹配到之后,匹配将立刻结束。
5. @符号
Such a location is not used for a regular request processing, but instead used for request redirection.
6.
If a location is defined by a prefix string that ends with the slash character, and requests are processed by one of proxy_pass, fastcgi_pass, uwsgi_pass,
scgi_pass, or memcached_pass, then the special processing is performed. In response to a request with URI equal to this string, but without the trailing
slash, a permanent redirect with the code will be returned to the requested URI with the slash appended. If this is not desired, an exact match of the
URI and location could be defined like this:
7. 嵌套的location
https://serverfault.com/questions/496371/nested-locations-nginx
三
读nginx与location相关的代码
[nginx] load balancing & location的更多相关文章
- NGINX Load Balancing – TCP and UDP Load Balancer
This chapter describes how to use NGINX Plus and open source NGINX to proxy and load balance TCP and ...
- NGINX Load Balancing - HTTP Load Balancer
This chapter describes how to use NGINX and NGINX Plus as a load balancer. Overview Load balancing a ...
- Load Balancing with NGINX 负载均衡算法
Using nginx as HTTP load balancer Using nginx as HTTP load balancer http://nginx.org/en/docs/http/lo ...
- NGINX Docs | Load Balancing Apache Tomcat Servers with NGINX Open Source and NGINX Plus
NGINX Docs | Load Balancing Apache Tomcat Servers with NGINX Open Source and NGINX Plushttps://docs. ...
- How Network Load Balancing Technology Works--reference
http://technet.microsoft.com/en-us/library/cc756878(v=ws.10).aspx In this section Network Load Balan ...
- 负载均衡(Load Balancing)学习笔记(二)
概述 文章负载均衡(Load Balancing)学习笔记(一) 讲述了负载均衡的一般性原理,本文继续介绍常见的实现负载均衡的方法. HTTP重定向 HTTP重定向服务器是一台普通的Web服务器,用户 ...
- 负载均衡(Load Balancing)学习笔记(一)
概述 在分布式系统中,负载均衡(Load Balancing)是一种将任务分派到多个服务端进程的方法.例如,将一个HTTP请求派发到实际的Web服务器中执行的过程就涉及负载均衡的实现.一个HTTP请求 ...
- Elastic Load Balancing with Sticky Sessions
Elastic Load Balancing with Sticky Sessions — Shlomo Swidler https://shlomoswidler.com/2010/04/elast ...
- How to Configure Tomcat/JBoss and Apache HTTPD for Load Balancing and Failover
http://java.dzone.com/articles/how-configure-tomcatjboss-and In this post we will see how to setup a ...
随机推荐
- vue-worker的介绍和使用
vue-worker把复杂的web worker封装起来,提供一套非常简明的api接口,使用的时候可以说像不接触worker一样方便.那么具体怎么使用呢? 安装 npm i -S vue-worker ...
- TCP/IP四层模型讲解笔记
本文转载自:http://www.vuln.cn/2041 OSI七层模型 表示层:用来解码不同的格式为机器语言,以及其他功能. 会话层:判断是否需要网络传输. 传输层:识别端口来指定服务器,如指 ...
- 【iCore4 双核心板_ARM】例程三:EXTI中断输入实验——读取ARM按键状态
实验原理: 按键的一端与STM32的GPIO(PB9)相连,且PB9外接一个1k大小的限流上接电阻. 初始化时把PB9设置成输入模式,当按键弹起时,PB9由于上拉电阻的作用呈高电平(3.3V): 当按 ...
- 【emWin】例程十四:xbf外置字体
介绍: 本例将xbf格式文件放到SD卡中,通过读取SD卡中的字库文件在液晶上显示文字. 实验指导书及代码包下载: 链接:http://pan.baidu.com/s/1mhTdYeG 密码:aka ...
- ASP.NET IIS Registration Tool (Aspnet_regiis.exe)
IIS Version Special cases for 32-bit versions of Aspnet_regiis.exe 6.0 You can run the 32-bit versio ...
- 关于Unity中NGUI的背包实现之Scrollview(基于Camera)
基于UIPanel的scrollview实现方式在移动设备上的性能不如基于camera的方式.因为UIPanel的scrollview实现方式要渲染很多的道具图,性能自然就降低了.如果是用第二个摄像机 ...
- Mysql 查询decimal 引号‘’增加精度
sql 通过decimal条件查询添加和不添加引号的区别 SELECT * FROM meta_variable WHERE DataTableID = 123456 # decimal类型 AND ...
- 蓝牙mesh介绍
了解一下关于蓝牙Mesh的知识. 蓝牙mesh网络使用,并且依赖于低功耗蓝牙(BLE).低功耗蓝牙技术是蓝牙mesh使用的无线通信协议栈. 蓝牙BR / EDR能够实现一台设备到另一台设备的连接和通信 ...
- Linux目录详细说明大全(推荐)
Linux目录详细说明大全,方便你以后合理规划及管理 "/" : 根目录Linux文件系统的入口.也是最高级,最重要的的目录.除衍生出其它目录,还和系统的开机,还原,系统修复有的, ...
- 仿照支付宝账单界面--listview分组显示 用来做!发!财树充值交易明细
QQ图片20150430155638.png (151.65 KB, 下载次数: 32) 下载链接: http://pan.baidu.com/s/1kVMY1SV 密码: i8ta