linux集群架构--web服务器--nginx检查模块/算法/rewrite知识补充

news2024/9/21 0:33:32

web集群-负载均衡

轮询算法

(1)概述

决定负载均衡如何把请求分发给后端节点,这种分发的方式就是轮询算法

(2)轮询算法

面试题:说说常见nginx轮询算法

rr,wrr,ip_hash,lc算法(最小连接数),wlc(加权最小连接数)

负载 说明

  • rr轮询:round robin 轮询,默认的循环访问

  • wrr : 加权轮询,在轮询的基础还是那个增加权重功能,server中weight就是加权轮询

  • ip_hash:ip哈希,只要客户端ip一样,就会一直访问同一个后端节点(用户请求与web服务器绑定)结局会话保持/会话共享,可能导致负载不均

  • xxx_hash:url_hash只要用户访问的url相同,uri相同,就会访问相同的web服务器;缓存服务器:静态资源缓存

  • least_conn:最小连接数,lc算法,也可以配合上权重weight,wlc权重最小连接数

  • 一致性hash算法;

ip_hash轮询逻辑图

在这里插入图片描述

  • ip_hash
upstream lb_pools {

      ip_hash;
      server 10.0.0.7:80 weight=1 max_fails=3 fail_timeout=30s;
      server 10.0.0.8:80 weight=1max_fails=3fail_timeout=30s;
}

server {
     listen 80;
     server_name lb.wulinlinux.cn;
     error_log/var/log/nginx/lb-error.lognotice;
     access_log/var/log/nginx/lb-access.log main;
     location / {
           proxy_pass http://lb_pools;
           proxy_set_header Host $http_host;
           proxy_set_header X-Forwarded-For$proxy_add_x_forwarded_for;
           }
}
  • url_hash
hash $request_uri;

FAQ

Hash算法一台机器宕机的情况下会报错吗?

  • 切换

案例01:对负载均衡进行状态检查

  • 负载均衡状态检查模块upstream check模块,web展示

  • 默认ngx没有安装,是一个第三方的模块,需要编译安装ngx添加这个模块即可.生成ngx命令

  • 步骤:

    1. 找一台db01(无ngx即可)
    2. 编译安装tengine,生成ngx命令,替代lb上ngx的命令即可.
  • 下载tengine代码

#下载

#解压
进入到解压后的目录
  • 编译安装
在官网下载之后,传到linux中进行解压
[root~]#tar xf tengine-2.3.3.tar.gz
[root~]#ll
total  2788
-rw--------,  1  root root  1539 jan 9 09:07  anaconda-ks.cfg
drwxrwxr-x,   13 root root  328  Mar 29  2021 tengine-2.3.3
-rw-r--r--    1  root root  2848144 Feb 17 09:34  tengine-2.3.3.tar.gz
[root~]#cd tengine-2.3.3/
[root ~/tengine-2.3.3]#ll



安装依赖
./configure 配置(生成Makefile)指定各种位置,否则就会安装到/usr/local/
make      编译(根据Makefile进行编译--->生成对应的命令)
make install 创建目录,复制文件..

#安装依赖
yum install -y pcre-devel   openssl-devel

#配置的步骤
./configue   --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx  --modules-path=/usr/lib64/nginx/modules  --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log  -http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid  --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp proxy-temp-path=/var/cache/nginx/proxy_temp  --http-fastcgi-temp-path=/var/cache/nginx/fasctgi_temp --
user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module 
with-http_auth_request_module --with-http_dav_module
--with-http_flv_module --with-http_gunzip_module --
with-http_gzip_static_module --with-http_mp4_module
-- with-http_random_index_module --with http_realip_module --with-http_secure_link_module --
with-http_slice_module -- with-http_ssl_module -- with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with -mail_ssl_module --with-stream --with-
stream_realip_module--with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-O2 -g
-pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie'  

--add-module=modules/ngx_http_upstream_check_module  
--add-module=modules/ngx_http_upstream_session_sticky_module/


#进行编译
make -j 1 #cpu核心总数决定,加速编译

#最后的安装(略)
不需要执行make  install
我们不需要在当前db01主机安装tengine

检查编译后生成的命令即可
./objs/nginx -V

echo $?
0 执行成功
;~

[root ~/tengine-2.3.3]#scp ./jobs/nginx  lb01:~

[root ~]ll nginx
-rwxr-xr-x 1 root root 105432 Feb 17  nginx
[root ~] nginx -V

在这里插入图片描述
这个为新版本编译安装的nginx,旧版本的在/sbin/nginx -V目录下
在这里插入图片描述
在这里插入图片描述

[root ~]#cd /etc/nginx/conf.d/
[root /etc/nginx/conf.d]#vim admin.conf 

在这里插入图片描述
检查语法并进行重启:
在这里插入图片描述
浏览器访问admin.wulinlinux.cn网站:
在这里插入图片描述
将nginx关闭之后,检查模块fall counts会从0逐渐增加数量为终止点,然后报红线提示!!

![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/e29fbfeef6bf418e956afda13f9dc77e.png)
当重新打开nginx,两次之后显示打开;那能不能十次显示up(打开)状态,或者别的次数呢?

- 可以设置想要的几次后状态显示
注意:如果后端web有多个虚拟主机.

upstream check进行访问的时候默认使用的ip方式进行访问.

在发出http请求的时候指定域名

check_http_send "HEAD / HTTP/1.0\r\nHost: lb.oldboylinux.cn\r\n\r\n";

在这里插入图片描述
根据官方案例进行配置:
https://tengine.taobao.org/document_cn/http_upstream_check_cn.html

upstream cluster1 {
       # simple round-robin
         server 192.168.0.1:80;
         server 192.168.0.2:80;

         check interval=3000 rise=2 fall=5 timeout=1000 type=http; #相当于curl命令访问curl -I
        #           检查间隔 ms 成功2次,存活  失败五次认为挂了  超时时间 ms 检查类型
         check_http_send "Head /HTTP/1.0\r\n\r\n";
        #           请求方法uri(uri最好反应业务是否正常,找开发写一个页面)
         check_http_expect_alive http_2xx http_3xx;
        #认为是成功的状态码 2xx  3xx
         
         }
server {
     listen 80;
     
     location /1 {
        proxy_pass http://cluster1;
     }
     
     location /2 {
        proxy_pass http://cluster2;
     }
     
     location /status {
        check_status;
        
        access_log   off;
        #allow 白名单
        #deny all;
     }
}
,
找开发写个页面
)
     
check_http_expect_alive http_2xx http_3xx;
       #认为是成功的状态码
2xx 3xx

upstream_check模块指令

在这里插入图片描述

  • 完整的配置:
upstream lb_pools {
           server 10.0.0.7:80 weight=1  max_fails=3 fail_timeout=30s;
           server 10.0.0.8:80 weight=1  max_fails=3 fail_timeout=30s; 
           
           check interval=3000 rise=2 fall=5 timeout=1000 type=http;
           check_http_send "HEAD / HTTP/1.0\r\n\r\n";
           check_http_expect_alive http_2xx http_3xx;
}

server {
      listen 80;
      server_name admin.wulinlinux.cn
      error_log /var/log/nginx/admin.log notice;
      access_log /var/log/nginx/admin-access.log main;
      location / {
          proxy_pass http://admin_pools;
          proxy_set_header Host $http_host;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      }
      location /lb_status {
         check_status;
         access_log off;
         allow 10.0.0.1;
         allow 10.0.0.0/24;
         deny all;
      }
}

案例02:nginx平滑升级案例

在这里插入图片描述

  • 找一个web服务器
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    现在已经准备好了环境:

完整配置

#检查的当前环境

[root /etc/nginx/conf.d]# nginx -v
nginx version: nginx/1.22.0

#启动ngx
[root /etc/nginx/conf.d]# systemctl start nginx
[root /etc/nginx/conf.d]# ps -ef |grep nginx
root       7404      1  0 15:32 ?        00:00:00
nginx: master process /usr/sbin/nginx -c
/etc/nginx/nginx.conf nginx      7405   7404  0 15:32 ?        00:00:00
nginx: worker process
root       7407   3011  0 15:32 pts/1    00:00:00 grep --color=auto nginx
#查看pid
[root /etc/nginx/conf.d]# ll /var/run/nginx.pid
-rw-r--r-- 1 root root 5 Sep  7 15:32
/var/run/nginx.pid
[root /etc/nginx/conf.d]# cat /var/run/nginx.pid*
7404

#准备升级,备份ngx命令,替代ngx命令
mv /sbin/nginx /sbin/nginx-v1.22.0
mv nginx-tengine-2.3.3  /sbin/nginx
#检查替换后结果
nginx -V
Tengine version: Tengine/2.3.3
nginx version: nginx/1.18.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
built with OpenSSL 1.0.2k-fips  26 Jan 2017
TLS SNI support enabled

configure arguments: --prefix=/etc/nginx --sbin-
path=/usr/sbin/nginx --modules-
path=/usr/lib64/nginx/modules --conf-
path=/etc/nginx/nginx.conf --error-log-
path=/var/log/nginx/error.log --http-log-
path=/var/log/nginx/access.log --pid-
path=/var/run/nginx.pid --lock-
path=/var/run/nginx.lock --http-client-body-temp-
path=/var/cache/nginx/client_temp --http-proxy-temp-
path=/var/cache/nginx/proxy_temp --http-fastcgi-
temp-path=/var/cache/nginx/fastcgi_temp --http-
uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-
scgi-temp-path=/var/cache/nginx/scgi_temp --
user=nginx --group=nginx --with-compat --with-file-
aio --with-threads --with-http_addition_module --
with-http_auth_request_module --with-http_dav_module
--with-http_flv_module --with-http_gunzip_module --
with-http_gzip_static_module --with-http_mp4_module
--with-http_random_index_module --with-
http_realip_module --with-http_secure_link_module --
with-http_slice_module --with-http_ssl_module --
with-http_stub_status_module --with-http_sub_module
--with-http_v2_module --with-mail --with-
mail_ssl_module --with-stream --with
stream_realip_module --with-stream_ssl_module --
with-stream_ssl_preread_module --with-cc-opt='-O2 -g
-pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -
fstack-protector-strong --param=ssp-buffer-size=4 -
grecord-gcc-switches -m64 -mtune=generic -fPIC' --
with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie' --add-
module=modules/ngx_http_upstream_check_module --add-
module=modules/ngx_http_upstream_session_sticky_module/

#准备新老交替
[root ~]# kill -USR2 `cat /var/run/nginx.pid`

#生成1新的pid文件和重命名一个pid文件
[root ~]# ll /var/run/nginx.pid*
-rw-r--r-- 1 root root 5 Sep  7 15:34  /var/run/nginx.pid
-rw-r--r-- 1 root root 5 Sep  7 15:32 /var/run/nginx.pid.oldbin

[root ~]# cat /var/run/nginx.pid.oldbin
7404

[root ~]# ps -ef |grep nginx
root       7404      1  0   15:32 ?        00:00:00
nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
nginx      7405   7404  0 15:32 ?        00:00:00 nginx: worker process
root       7442   7404  0 15:34 ?        00:00:00
nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
nginx      7443   7442  0 15:34 ?        00:00:00 nginx: worker process
root       7463   3011  0 15:35 pts/1    00:00:00 grep --color=auto nginx

[root ~]# kill 7404
[root ~]# ps -ef |grep nginx
root       7442      1  0 15:34 ?        00:00:00
nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
nginx      7443   7442  0 15:34 ?        00:00:00 nginx: worker process
root       7483   3011  0 15:37 pts/1    00:00:00 grep --color=auto nginx

[root ~]# ss -lntup |grep 80
tcp   LISTEN     0      128       *:80            
       *:*                   users:
(("nginx",pid=7443,fd=10),("nginx",pid=7442,fd=10))

在这里插入图片描述

web集群-Nginx-rewrite功能

a) nginx重定向概述

  • 重定向:也叫url重定向,也叫url改写

  • 未来需求:

  1. 网站是http(80)—> https(443) URL重定向

用户http://www.baidu.com —> https:///www.baidu.com/

  1. 根据客户端访问类型进行跳转

    ​ 希望根据用户客户端进行判断

    • 如果用户的客户端是iOS,iphone,android,访问 m.wulinlinux.com

    • 否则默认访问www.wulinlinux.com

    ​ www.wulinlinux.cn 如果用户使用的移动端则访问m.wulinlinux.cn URL重定向
    在这里插入图片描述

  2. 新老域名跳转:www.360buy.com —> jd.com

  3. 需要我们调整URL格式:伪静态(搜索引擎收入)运营要求

​ www.wulinlinux.cn/index.php

b) 模块与指令

  • rewrite模块
    在这里插入图片描述

if判断,一般与nginx变量一起使用

return指令

在这里插入图片描述

案例03:如果用户访问/admin/页面返回403

[root ~]#cat /etc/nginx/conf.d/rewrite.wulinlinux.cn.conf
server {
   listen 80;
   server_name rewrite.wulinlinux.cn;
   root /app/code/rewrite;
   location / {
       index index.html;
   }
   location /admin/ {
       return 403;
   }
}

在这里插入图片描述
创建目录:

[root /etc/nginx/conf.d]# mkdir -p /app/code/rewrite/admin/ 
[root /etc/nginx/conf.d]# echo rewrite index  >   /app/code/rewrite/index.html
[root /etc/nginx/conf.d]# echo admin index >/app/code/rewrite/admin/index.html
[root /etc/nginx/conf.d]# curl -H Host:rewrite.wulinlinux.cn http://10.0.0.7/
rewrite index

[root /etc/nginx/conf.d]# curl -H Host:rewrite.wulinlinux.cn http://10.0.0.7/admin/
<html>
<head><title>403 Forbidden</title></head>
<body>
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx/1.22.1</center>
</body>
</html>

这里书写return 403;所有人禁止访问/admin/页面

案例04:域名间跳转

  • 用户访问rewrite.wulinlinux.cn --> www.baidu.com
  • 书写
server {
    listen 80;
    server_name rewrite.wulinlinux.cn;
    return 301 http://www.baidu.com;
}
  • 调试
curl -vL rewrite.wulinlinux.cn
curl -Lv  -H Host:rewrite.wulinlinux.cn  
http://10.0.0.7

-L --location跟随跳转,响应是301,302跳转的时候使用.
systemctl reload nginx

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
推荐浏览器插件:

https://www.chromefk.com/redirect-path.html

https://share.learnfk.com/f/18605620-528446570-266096

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

小结

  • return +状态码 与location 或 if
  • 实现跳转
    1. 返回指定的状态码
    2. 域名跳转(新旧域名)
    3. http --> https跳转

if判断

案例05 rewrite.wulinlinux.cn 网站只允许GET,POST,HEADE三种请求方法,其他禁止访问

  • if用于进行判断,通过nginx中变量
  • 可以比大小
  • 可以进行等于,不等于
  • 也可以进行匹配(过滤)
if指令在nginx中的格式
if (条件) {
     满足条件执行的内容
}

if指令,格式:

  1. 放置在server,location中

  2. 可以使用的符号

 常用~~*,!~*
 nginx取反,排除,只能用if
使用到的变量 : $request_method 取出请求
[root /etc/nginx/conf.d]#vim rewrite.conf
server {
   listen 80;
   server_name rewrite.wulinlinux.cn;
   root /app/code/rewrite;
   
   if ( $requerst_method !~ "GET|POST" ) {
       return 403;
   }
   location / {
       index index.html;
   }
}
  • 测试:
#GET
请求正常
curl   -H Host:rewrite.oldboylinux.cn  http://10.0.0.7
rewrite index

#HEAD请求失败
curl  -I  -H Host:rewrite.wulinlinux.cn  
http://10.0.0.7
HTTP/1.1 403 Forbidden
Server: nginx/1.22.1


Content-Type: text/html
Content-Length: 153
Connection: keep-alive

set

  • 用于创建nginx变量
#shell写法
wulin=666
echo $wulin
#ngx中写法
set  $变量值;
set $wulin 999;

提示:nginx变量,进行赋值与进行使用都需要加上$符号

[root /etc/nginx/conf.d]# cat rewrite.wulinlinux.cn.conf
server {
    listen 80;
    server_name rewrite.wulinlinux.cn;
    set $wulin "wulin666";
    return 200  $wulin;
}
[root /etc/nginx/conf.d]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf
syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test
is successful
[root /etc/nginx/conf.d]# systemctl reload
nginx  
[root /etc/nginx/conf.d]# curl -H Host:rewrite.wulinlinux.cn 10.0.0.7
wulin666[root /etc/nginx/conf.d]#
[root /etc/nginx/conf.d]# cat rewrite.wulinlinux.cn.conf
server {
      listen 80;
      server_name rewrite.wulinlinux.cn;
      set  $wulin $http_host$request_uri;
      return 200  $wulin;
}
[
root /etc/nginx/conf.d]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf
syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test
is successful

[root /etc/nginx/conf.d]# systemctl reload
nginx  
[root /etc/nginx/conf.d]# curl -H Host:rewrite.wulinlinux.cn
10.0.0.7
rewrite.wulinlinux.cn/[root/etc/nginx/conf.d]#
[root /etc/nginx/conf.d]#
[root /etc/nginx/conf.d]# curl -H Host:rewrite.wulinlinux.cn
10.0.0.7/wulin.html
rewrite.wulinlinux.cn/wulin.html

案例06:设置网站是否为维护状态:如果维护状态:返回503状态码,否则正常访问

  • 流程

    1. 设置标记$flag默认是0.
    2. 判断如果$flag的值是1则网站返回503
server {
     listen 80;
     server_name rewrite.wulinlinux.cn;
     root /app/code/rewrite; 
     set  $flag 0;
     #include conf.d/rewrite-status.var; 
     if ( $flag = 1) {
            return 503;
     }
     location / {
              index index.html;
     }
}
  • 变量文件独立开
[root /etc/nginx/conf.d]# cat rewrite.wulinlinux.cn.conf
server {
    listen 80;
    server_name rewrite.wulinlinux.cn;
    root /app/code/rewrite;
    include conf.d/rewrite-status.flag;
    if ( $flag = 1 ) {
         return 503;
   }
    location / {
index index.html;
   }
}

[root /etc/nginx/conf.d]# cat rewrite-status.flag
set $flag 0[root /etc/nginx/conf.d]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf
syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test
is successful
[root /etc/nginx/conf.d]# systemctl reload nginx  
[root /etc/nginx/conf.d]# curl -H Host:rewrite.wulinlinux.cn
10.0.0.7
rewrite.wulinlinux.cn
[root /etc/nginx/conf.d]# sed -i 's#0#1#g' rewrite-status.flag
[root /etc/nginx/conf.d]# cat rewrite-status.flag
set $flag 1;
[root /etc/nginx/conf.d]# systemctl reload nginx
[root /etc/nginx/conf.d]# curl -H Host:rewrite.wulinlinux.cn 10.0.0.7
<html>
<head><title>503 Service Temporarily
Unavailable</title></head>
<body>
<center><h1>503 Service Temporarily Unavailable</h1>
</center>
<hr><center>nginx/1.22.0</center>
</body>
</html>
set $flag 0;
if ( $flag ) {
    return 503;
}
if ( $flag = 1) 执行 return 503;

if ( $flag = 1) 不会执行 503

小结
一般很少单独使用,一般与if搭配使用

rewrite指令

rewrite指令

  • rewrite正则用于匹配用户请求的uri.
  • 命令的格式与sed 's###g’类似,实现替换功能,rewrite替换url内容.(改写)
    在这里插入图片描述
    在这里插入图片描述

案例07:域名跳转

[root /etc/nginx/conf.d]# vim rewrite.conf 
server {
      listen 80;
      server_name rewrite.wulinlinux.cn;
      #return 301 http://www.baidu.com$request_uri;
      #http://rewrite.wulinlinux.cn/images/wulin.txt
      #http://rewrite.wulinlinux.cn
      rewrite ^(.*)$   http://www.baidu.com$1 permenant(永久);
}

在这里插入图片描述
浏览器访问http://rewrite.wulinlinux.cn/wulin.txt:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

Rewrite各种标记

在这里插入图片描述

  • 测试break与last的代码:
server {
  listen 80;
  server_name flag.wulinlinux.cn;
  root /app/code/flag;
  error_log /var/log/nginx/flag-error.log notice;
  rewrite_log on; #需要错误日志debug.... notice
  location / {
          rewrite /1.html /2.html ;
          rewrite /2.html /3.html ;
  }
  location /2.html {
          rewrite /2.html /3.html ;
  }
  location /3.html {
          rewrite /3.html /a.html ;
  }
}
echo 1.html url >/app/code/flag/1.html
echo 2.html url >/app/code/flag/2.html
echo 3.html url >/app/code/flag/3.html
echo a.html url >/app/code/flag/a.html
echo b.html url >/app/code/flag/b.html

1.访问/1.html显示a.html内容
[root /etc/nginx/conf.d]# curl -H Host:flag.wulinlinux.cn 10.0.0.7/1.html
a.html url
2.访问 /2.html显示a.html内容
[root /etc/nginx/conf.d]# curl -H Host:flag.wulinlinux.cn 10.0.0.7/2.html
a.html url
3.在rewrite /1.html /2.html的时候加上标记break标记.rewrite /1.html /2.html break;执行完成rewrite后直接结束.
ver {
   listen 80;
   erver_name flag.wulinlinux.cn;
   root /app/code/flag;
   error_log /var/log/nginx/flag-error.log notice;
   rewrite_log on; #需要错误日志debug .... notice
   location / {
        rewrite /1.html /2.html break;
        rewrite /2.html /3.html ;
  }
   location /2.html {
         rewrite /2.html /3.html ;
  }
  location /3.html {
         rewrite /3.html /a.html ;
  }
}
[root /etc/nginx/conf.d]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf
syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[root /etc/nginx/conf.d]# systemctl reload nginx
[root /etc/nginx/conf.d]# curl -H Host:flag.wulinlinux.cn 10.0.0.7/1.html 2.html url

4.在rewrite /1.html /2.html的时候加上标记last标记.注意这一步修改下配置文件,创建新的页面b.html.
[root /etc/nginx/conf.d]# cat flag.wulinlinux.cn.conf
server {
  listen 80;
  server_name flag.wulinlinux.cn;
  root /app/code/flag;
  error_log /var/log/nginx/flag-error.log notice;
  rewrite_log on; #需要错误日志debug ....notice
  location / {
           rewrite /1.html /2.html last;
           rewrite /2.html /3.html ;
  }
  location /2.html {
           rewrite /2.html /b.html ;
  }
  location /3.html {
           rewrite /3.html /a.html ;
  }
}
[root /etc/nginx/conf.d]# curl -H Host:flag.wulinlinux.cn
10.0.0.7/1.html
b.html url

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1936334.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

CH03_布局

第3章&#xff1a;布局 本章目标 理解布局的原则理解布局的过程理解布局的容器掌握各类布局容器的运用 理解 WPF 中的布局 WPF 布局原则 ​ WPF 窗口只能包含单个元素。为在WPF 窗口中放置多个元素并创建更贴近实用的用户男面&#xff0c;需要在窗口上放置一个容器&#x…

基于 Three.js 的 3D 模型加载优化

作者&#xff1a;来自 vivo 互联网前端团队- Su Ning 作为一个3D的项目&#xff0c;从用户打开页面到最终模型的渲染需要经过多个流程&#xff0c;加载的时间也会比普通的H5项目要更长一些&#xff0c;从而造成大量的用户流失。为了提升首屏加载的转化率&#xff0c;需要尽可能…

怎么关闭 Windows 安全中心,手动关闭 Windows Defender 教程

Windows 安全中心&#xff08;也称为 Windows Defender Security Center&#xff09;是微软 Windows 操作系统内置的安全管理工具&#xff0c;用于监控和控制病毒防护、防火墙、应用和浏览器保护等安全功能。然而&#xff0c;在某些情况下&#xff0c;用户可能需要关闭 Windows…

通义千问AI模型对接飞书机器人-集成飞书机器人(2-2)

接上一篇 通义千问AI模型对接飞书机器人-模型配置&#xff08;2-1&#xff09; 1、通过飞书机器人对接ai的在线接口 参考文档&#xff1a;发送 HTTP 请求 1.1 创建飞书应用 创建流程 配置http请求 http请求地址上一篇百炼平台配置的应用地址 1.2 企业自建应用对接AI 添加应用…

小程序-5(vant组件+全局数据共享+分包+tabBar案例)

目录 1.使用npm包 小程序对npm的支持和限制 使用vant组件 使用CSS变量定制主题样式 API的promise化 2.全局数据共享 小程序中的全局数据共享方案 安装MobX相关的包 创建MobX的store实例 将Store中的成员绑定到页面中 在页面上使用Store中的成员 将Store中的成员绑定…

pyqt/pyside QTableWidget失去焦点后,选中的行仍高亮的显示

正常情况下pyqt/pyside的QTableWidget&#xff0c;点击input或者按钮失去焦点后 行的颜色消失了 如何在失去焦点时保持行的选中颜色&#xff0c;增加下面的代码&#xff1a; # 获取当前表格部件的调色板 p tableWidget.palette()# 获取活跃状态下的高亮颜色和高亮文本颜色&a…

防火墙内容安全综合实验

一、实验拓扑 二、实验要求 1&#xff0c;假设内网用户需要通过外网的web服务器和pop3邮件服务器下载文件和邮件&#xff0c;内网的FTP服务器也需要接受外网用户上传的文件。针对该场景进行防病毒的防护。 2&#xff0c;我们需要针对办公区用户进行上网行为管理&#xff0c;要…

仿源码大师主界面UI的iAPP源文件

仿源码大师首页主界面的布局 首页&#xff0c;分类&#xff0c;需求&#xff0c;我的 就只有这几个界面内容而已 资源静态 没有任何动画和功能 纯UI布局 纯UI布局 他的最新版已经不是这个UI布局 放心使用 以学习参考为目的&#xff0c;如有不妥望告知 原创&#xff0c;纯…

国内微短剧系统平台抖音微信付费小程序app开发源代码交付

微短剧作为当下热门的内容&#xff0c;结合抖音平台的广泛用户基础&#xff0c;开发微短剧付费小程序APP具有显著的市场潜力&#xff0c;用户对于短剧内容的需求旺盛&#xff0c;特别是在言情、总裁、赘婿等热门题材方面&#xff0c;接下来给大家普及一下微短剧小程序系统。 顺…

数据结构(5.2_3)——二叉树的存储结构

二叉树的顺序存储 #define MAXLEN 255struct TreeNode {ElemType value;//结点中的数据元素bool isEmpty;//结点是否为空 };void main() {TreeNode t[MaxSize]; } 定义一个长度为MaxSize的数组t&#xff0c;按照从上至下、从左至右的顺序依次存储完全二叉树中的各个结点 几个…

【matlab 投影寻踪】基于PSO算法的最优投影方向优化

一 投影寻踪算法 投影寻踪是处理和分析高维数据的一类统计方法&#xff0c;其基本思想是将高维数据投影到低维&#xff08;1&#xff5e;3维&#xff09;子空间上&#xff0c;寻找出反映原高维数据的结构或特征的投影&#xff0c;以达到研究和分析高维数据的目的。1974年&…

Linux下开放指定端口

比如需要开放82端口&#xff1a; #查询是否开通 firewall-cmd --query-port82/tcp#开放端口82 firewall-cmd --zonepublic --add-port82/tcp --permanent#重新加载防火墙 firewall-cmd --reload

云原生系列 - Jenkins

Jenkins Jenkins&#xff0c;原名 Hudson&#xff0c;2011 年改为现在的名字。它是一个开源的实现持续集成的软件工具。 官方网站&#xff08;英文&#xff09;&#xff1a;https://www.jenkins.io/ 官方网站&#xff08;中文&#xff09;&#xff1a;https://www.jenkins.io…

2024“钉耙编程”中国大学生算法设计超级联赛(1)

Rank 待补1003树&#xff0c;1005博弈&#xff0c;1012并。 星星 - HDU 7434 - Virtual Judge 这题第一眼云的时候感觉是贪心&#xff0c;后来要上手写代码感觉无从下手&#xff0c;遂反映过来是动态规划。 然后就是一个很简单的dp&#xff0c;外层枚举物品&#xff0c;里面枚举…

多类别支持向量机(Multi-class SVM)

多类别支持向量机&#xff08;Multi-class SVM&#xff09;是一种扩展二分类支持向量机以处理多类别分类问题的方法。常见的方法有“一对一”&#xff08;one-vs-one&#xff09;和“一对多”&#xff08;one-vs-rest&#xff09;。 一、数学模型理论推导 1.1 一对多&#xf…

时间卷积网络(TCN):序列建模的强大工具(附Pytorch网络模型代码)

1. 引言 引用自&#xff1a;Bai S, Kolter J Z, Koltun V. An empirical evaluation of generic convolutional and recurrent networks for sequence modeling. arXiv[J]. arXiv preprint arXiv:1803.01271, 2018, 10. 时间卷积网络&#xff08;Temporal Convolutional Networ…

Six common classification algorithms in machine learning

分类算法是一种机器学习算法&#xff0c;其主要目的是从数据中发现规律并将数据分成不同的类别。分类算法通过对已知类别训练集的计算和分析&#xff0c;从中发现类别规则并预测新数据的类别。常见的分类算法包括决策树、朴素贝叶斯、逻辑回归、K-最近邻、支持向量机等。分类算…

减分兔搜题-12123学法减分20题目及答案 #媒体#职场发展

对于即将参加驾驶考试的朋友来说&#xff0c;掌握一些经典题目和答案至关重要。今天&#xff0c;我就为大家带来了这样一份干货——20道驾驶考试题目和答案&#xff0c;助你轻松应对考试&#xff01;这些题目不仅包括了考试中常考的内容&#xff0c;还有针对难点和重点的详细解…

​数据结构之初始二叉树(3)

找往期文章包括但不限于本期文章中不懂的知识点&#xff1a; 个人主页&#xff1a;我要学编程(ಥ_ಥ)-CSDN博客 所属专栏&#xff1a;数据结构&#xff08;Java版&#xff09; 二叉树的基本操作 通过上篇文章的学习&#xff0c;我们简单的了解了二叉树的相关操作。接下来就是有…

前端组件化技术实践:Vue自定义顶部导航栏组件的探索

摘要 随着前端技术的飞速发展&#xff0c;组件化开发已成为提高开发效率、降低维护成本的关键手段。本文将以Vue自定义顶部导航栏组件为例&#xff0c;深入探讨前端组件化开发的实践过程、优势以及面临的挑战&#xff0c;旨在为广大前端开发者提供有价值的参考和启示。 一、引…