[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 ...
随机推荐
- Intelij U
1.https://link.jianshu.com/?t=http://idea.lanyus.com/,下载JetbrainsCrack-2.6.2.jar,放到bin目录 2.编辑bin目录下面 ...
- 关于Solaris 的磁盘的分区
也许是深受LINUX Windows fdisk 影响,每次看完Solaris的format命令,总是云里雾里.我今天总结一下,各位给点指点 一. Linux.Windows 传统的磁盘区层级, ...
- 安卓开发笔记——关于开源项目SlidingMenu的使用介绍(仿QQ5.0侧滑菜单)
记得去年年末的时候写过这个侧滑效果,当时是利用自定义HorizontalScrollView来实现的,效果如下: 有兴趣的朋友可以看看这篇文件<安卓开发笔记——自定义HorizontalScro ...
- Ubuntu:双(多)网卡绑定(bonding)配置
step 0:安装网卡绑定的功能 apt-get install ifenslave step 1:加载内核模块:编辑 /etc/modules,添加: bonding step 2:编辑网卡配 ...
- MySQL常见错误码及说明
1005:创建表失败1006:创建数据库失败1007:数据库已存在,创建数据库失败<=================可以忽略1008:数据库不存在,删除数据库失败<=========== ...
- linux log
adb shell logcat GOODIX:v *:s cat /proc/kmsg | grep "<<" ./cbootimg.sh adb shell get ...
- 安装redis出现cc adlist.o /bin/sh:1:cc:not found的解决方法
安装redis时 提示执行make命令时提示 CC adlist.o /bin/sh: cc: 未找到命令 问题原因:这是由于系统没有安装gcc环境,因此在进行编译时才会出现上面提示,当安装好gc ...
- android程序---->android多线程下载(二)
上篇我们讲到了android中下载的断点续传问题,今天我们开始学习下载的多线程问题.本次的多线程源码下载:androdi中多线程下载的实现代码.有关断点续传的问题,请参见博客:android程序--- ...
- css3整理--background-clip
background-clip语法: background-clip : border-box || padding-box || content-box 参数取值: border-box:此值为默认 ...
- R和Tableau平行坐标图
R平行坐标图 library(lattice)data(iris)parallelplot( ~ iris[1:4], iris, groups = Species, horizontal.a ...