[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 ...
随机推荐
- 大津法---OTSU算法
简介: 大津法(OTSU)是一种确定图像二值化分割阈值的算法,由日本学者大津于1979年提出.从大津法的原理上来讲,该方法又称作最大类间方差法,因为按照大津法求得的阈值进行图像二值化分割后,前景与背景 ...
- 奋斗STM32V3版ADC例程
https://wenku.baidu.com/view/a60b2042c850ad02de8041b7.html
- Java知多少(89)列表和组合框
有两种类型的菜单:下拉式菜单和弹出式菜单.本章只讨论下拉式菜单编程方法.菜单与JComboBox和JCheckBox不同,它们在界面中是一直可见的.菜单与JComboBox的相同之处是每次只可选择一个 ...
- ABBYY OCR技术教电脑阅读缅甸语(下)
文本行检测到之后,我们开始寻找单词和字母之间的间隙,这一次,我们运用了水平直方图,将大的间隙假设为单词之间的空隙,小的间隙理解为字母之间的空隙,检测缅甸文本中的空隙几乎没有出现问题,不像泰语,几乎没有 ...
- akka cluster sharding
cluster sharding 的目的在于提供一个框架,方便实现 DDD,虽然我至今也没搞明白 DDD 到底适用于是什么场合,但是 cluster sharding 却是我目前在做的一个 proje ...
- TensorFlow MNIST 问题解决
TensorFlow MNIST 问题解决 一.数据集下载错误 错误:IOError: [Errno socket error] [Errno 101] Network is unreachable ...
- autodesk fbx sdk sample里面的工程无法调试解决方法
1.项目属性->常规中的目标文件名改为1 2.链接器->调试中的生成程序数据库文件改成:$(OutDir)1.pdb 3.连接器->常规中的输出文件改成:$(OutDir)1.exe ...
- solus 系统 - 安装 mariadb
# 安装 mariadb(这个系统没有 mysql 库) $ sudo eopkg it mariadb $ sudo eopkg it mariadb-server # 初始化数据文件地址 $ su ...
- win怎么设置最快捷的下滑关机
win怎么设置最快捷的下滑关机 1.在C:\Windows\System32下找到SlideToShutDown.exe文件发送一份到桌面快捷方式 2.右键此快捷方式--属性--更换图表--更换一个自 ...
- 游标SQL Cursor 基本用法
http://www.cnblogs.com/Gavinzhao/archive/2010/07/14/1777644.html 1 table1结构如下 2 id int 3 name va ...