将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的更多相关文章

  1. 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 ...

  2. NGINX Load Balancing - HTTP Load Balancer

    This chapter describes how to use NGINX and NGINX Plus as a load balancer. Overview Load balancing a ...

  3. Load Balancing with NGINX 负载均衡算法

    Using nginx as HTTP load balancer Using nginx as HTTP load balancer http://nginx.org/en/docs/http/lo ...

  4. 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. ...

  5. 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 ...

  6. 负载均衡(Load Balancing)学习笔记(二)

    概述 文章负载均衡(Load Balancing)学习笔记(一) 讲述了负载均衡的一般性原理,本文继续介绍常见的实现负载均衡的方法. HTTP重定向 HTTP重定向服务器是一台普通的Web服务器,用户 ...

  7. 负载均衡(Load Balancing)学习笔记(一)

    概述 在分布式系统中,负载均衡(Load Balancing)是一种将任务分派到多个服务端进程的方法.例如,将一个HTTP请求派发到实际的Web服务器中执行的过程就涉及负载均衡的实现.一个HTTP请求 ...

  8. Elastic Load Balancing with Sticky Sessions

    Elastic Load Balancing with Sticky Sessions — Shlomo Swidler https://shlomoswidler.com/2010/04/elast ...

  9. 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 ...

随机推荐

  1. 译:1. RabbitMQ Java Client 之 "Hello World"

    这些教程介绍了使用RabbitMQ创建消息传递应用程序的基础知识.您需要安装RabbitMQ服务器才能完成教程 1. 打造第一个Hello World 程序 RabbitMQ是一个消息代理:它接受和转 ...

  2. sql in not in 案例用 exists not exists 代替

    from AppStoke B WHERE B.Opencode=A.Code) in用extist代替 select distinct * from Stoke where Code not in ...

  3. 详解CUDA编程

    CUDA 是 NVIDIA 的 GPGPU 模型,它使用 C 语言为基础,可以直接以大多数人熟悉的 C 语言,写出在显示芯片上执行的程序,而不需要去学习特定的显示芯片的指令或是特殊的结构.” 编者注: ...

  4. vue手写的轮播图片,解决已经修改data中的值,页面标签已绑定,但页面没效果

    1.效果 2.index.html <!DOCTYPE html> <html lang="en"> <link> <meta chars ...

  5. PHP Backdoor + Reverse Shell on Vulnerable Website

    翻译总结自: https://shellgam3.com/2016/07/27/php-backdoor-reverse-shell-on-vulnerable-website/ 扫描Web服务器,爆 ...

  6. Java知多少(29)覆盖和重载

    在类继承中,子类可以修改从父类继承来的方法,也就是说子类能创建一个与父类方法有不同功能的方法,但具有相同的名称.返回值类型.参数列表. 如果在新类中定义一个方法,其名称.返回值类型和参数列表正好与父类 ...

  7. Error - SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM

    I find using the following works quite well for SQL min/max dates after many DB related errors: Date ...

  8. [原]OpenGL基础教程(一)多边形绘制

    1.opengl开发环境搭建 参考http://brothergrup.iteye.com/blog/1602471 2.为三角形填充颜色: 填充颜色函数为glColor(3/4)*(r,g,b)  ...

  9. SpringBoot thymeleaf使用方法,thymeleaf模板迭代

    SpringBoot thymeleaf使用方法,thymeleaf模板迭代 SpringBoot thymeleaf 循环List.Map ============================= ...

  10. [Linux] 硬盘构造与分区

    首先让我们从物理结构上了解一下硬盘的存储原理. 硬盘构造示意图: 1. head:磁头,磁盘盘面上的磁头,有几个磁头,就有几个盘面.从0开始编号,最大255,表示总共256个磁头. 2. cylind ...