当前位置: 首页 > news >正文

nginx测试rewrite

nginx测试rewrite

last :相当于 Apache 里的(L)标记,表示完成rewrite 匹配;
break: 本条规则匹配完成后,终止匹配,不再匹配后面的规则。
# 其中last 和 break 用来实现 URL 重写时,浏览器地址栏URL 地址不变
redirect: 返回 302 临时重定向,浏览器地址会显示跳转后的 URL 地址。
permanent: 返回 301永久重定向,浏览器地址栏会显示跳转后的URL 地址
#不配置将显示304
[root@node1 ~]# yum -y install gcc make pcre-devel openssl-devel
[root@node1 ~]# tar xf nginx-1.22.1.tar.gz
[root@node1 ~]# cd nginx-1.22.1/
[root@node1 nginx-1.22.1]# ./configure  --prefix=/usr/local/nginx  --user=nginx  --with-http_ssl_module
[root@node1 nginx-1.22.1]#  make && make install
[root@node1 nginx-1.22.1]# useradd nginx -s /sbin/nologin
[root@node1 nginx-1.22.1]# /usr/local/nginx/sbin/nginx
[root@node1 nginx-1.22.1]# cd /usr/local/nginx/
[root@node1 nginx]# mkdir html/static
[root@node1 nginx]# echo "html/static/index.html">html/static/index.html
[root@node1 nginx]# echo "html/static/node1.html">html/static/node1.html#访问显示
http://www.myweb.com/static/ -->  html/static/index.html
http://www.myweb.com/static/test.html -->  html/static/test.html
http://www.myweb.com/forum.php -->  404 Not Found

last :相当于 Apache 里的L)标记,表示完成rewrite 匹配;

break: 本条规则匹配完成后,终止匹配,不再匹配后面的规则。

redirect: 返回 302 临时重定向,浏览器地址会显示跳转后的URL 地址。

permanent: 返回301永久重定向,浏览器地址栏会显示跳转后的 URL 地址。

其中 last 和 break 用来实现 URL 重写时,浏览器地址栏URL 地址不变。

#访问  http://www.myweb.com/forum.php  -跳转->  html/static/test.htmlserver {listen       80;server_name www.myweb.com;# 本地目录重写# 状态码304 地址栏不变化  http://www.myweb.com/forum.phprewrite ^/forum.php$ /static/node1.html last;  # 状态码304 地址栏不变化  http://www.myweb.com/forum.phprewrite ^/forum.php$ /static/node1.html break;  # 状态码301 地址栏变为http://www.myweb.com/static/test.htmlrewrite ^/forum.php$ /static/test.html permanent;# 状态码302 地址栏变为http://www.myweb.com/static/test.htmlrewrite ^/forum.php$ http://www.myweb.com/static/test.html last;#本站 url跳转  url地址栏变化, last、break、redirect都是302# 状态码302 地址栏变为http://www.myweb.com/static/test.htmlrewrite ^/forum.php$ http://www.myweb.com/static/test.html last;#forum.php状态码301 地址栏变为http://www.myweb.com/static/test.htmlrewrite ^/forum.php$ http://www.myweb.com/static/test.html permanent;# 跳百度# forum.php状态码302 地址栏变为 http://www.baidu.comrewrite ^/forum.php$ http://www.baidu.com break; # last、redirect也是302#forum.php状态码301 地址栏变为 http://www.baidu.comrewrite ^/forum.php$ http://www.baidu.com permanent;location / {...浏览器Disable cache 访问
    location ~ .*\.(html|htm|gif|jpg|jpeg|bmp|png|ico|txt|js|css)$ {root html; # 绝对路径也可以完成访问   /usr/local/nginx/html;}

[root@node1 baidu]# wget -r -x http://fjxplz.com/1004.html[root@node1 html] mkdir weihu
[root@node1 html]# echo   "维护中...">weihu/index.html#  http://www.myweb.com   维护
server {listen       80;server_name www.myweb.com;# 3、最终还是跳到维护页面rewrite ^/forum.php$ http://www.myweb.com/static/test.html permanent  ;# 2、加了rewrite后跳转,跟下面的location的上下顺序影响rewrite ^/(.*)$ /weihu/index.html last;  # 所有页都跳维护页rewrite ^/$ /weihu/index.html last;   # 根页跳到维护页#rewrite ^/(.*)$ /weihu/index.html last;# 1、不加上面的rewrite时,默认首页 location ~ .*\.(html|htm|gif|jpg|jpeg|bmp|png|ico|txt|js|css)$ {#    location / {   与上面一样root html; # 绝对路径也可以完成访问   /usr/local/nginx/html;}        # 3、最终还是跳到维护页面http://www.myweb.com/forum.php--》static  --》2 /weihu/
192.168.1.11 - -  "GET /forum.php HTTP/1.1" 301 169 "-" "Wget/1.14 (linux-gnu)"
192.168.1.11 - -  "GET /static/test.html HTTP/1.1" 200 13 "-" "Wget/1.14 (linux-gnu)"
server {listen       80;server_name www.myweb.com;# 一直会301跳转,看日志或者wget看下过程rewrite ^/(.*)$ /weihu/index.html permanent;  # wget下或者看日志# 传递参数rewrite ^/(.*)$  http://www.baidu.com/$1 permanent;# myweb.com 跳转到baiduif ($host = 'myweb.com') {rewrite ^/(.*)$  http://www.myweb.com/$1 permanent;}

wget 查看

[root@node1 conf]# wget myweb.com
--2023-10-21 17:32:25--  http://myweb.com/
Resolving myweb.com (myweb.com)... 192.168.1.11
Connecting to myweb.com (myweb.com)|192.168.1.11|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently  # permanent
Location: http://www.myweb.com/ [following]
--2023-10-21 17:32:25--  http://www.myweb.com/	# 跳转后的 
Resolving www.myweb.com (www.myweb.com)... 192.168.1.11
Reusing existing connection to myweb.com:80.
HTTP request sent, awaiting response... 200 OK
Length: 13 [text/html]
Saving to: ‘index.html.2’# myweb.com 跳转到www.myweb.comif ($host = 'myweb.com') {rewrite ^/(.*)$  http://www.myweb.com/$1 last; # last不是上面的permanent}
[root@node1 conf]# wget myweb.com
--2023-10-21 17:30:57--  http://myweb.com/
Resolving myweb.com (myweb.com)... 192.168.1.11
Connecting to myweb.com (myweb.com)|192.168.1.11|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily #302  last
Location: http://www.myweb.com/ [following]
--2023-10-21 17:30:57--  http://www.myweb.com/	# 跳转后的   
Resolving www.myweb.com (www.myweb.com)... 192.168.1.11
Reusing existing connection to myweb.com:80.
HTTP request sent, awaiting response... 200 OK
Length: 13 [text/html]
Saving to: ‘index.html.1’

多种域名跳转

# 多种域名跳转if ($host != 'myweb.com'){rewrite ^/(.*)s http://www.myweb.com/$1 permanent;}
# 不存在的页面跳转    if ( !-e $request_filename){rewrite ^/(.*)$ /weihu/index.html last;}# 火狐浏览器跳转   if ($http_user_agent ~ firefox) { rewrite  ^/index.html$  /firefox/index.html;}

Nginx:Rewrite跳转+正则表达式+6个生产案列!内容过于真实

https://blog.csdn.net/weixin_48190891/article/details/108532802

Nginx rewrite常用全局变量详细介绍

https://blog.csdn.net/Blue92120/article/details/129003292

upstream lmsManagerAuth-backend {
server 7.180.171.42:8100 max_fails=3 fail_timeout=10s;
}location ~ ^/edx/lmsManagerAuth/api/datacenter/.*{rewrite /edx/lmsManagerAuth/(.*)  /$1 break;  #截取保留重写为api/datacenter/.*proxy_pass http://lmsManagerAuth-backend;
www.myweb.com.zh		www.myweb.com/zh
www.myweb.com.en		www.myweb.com/en在原来的配置文件/usr/local/nginx/conf/nginx.conf的http{}内末尾处加一句:
include /usr/local/nginx/conf.d/*.conf;[root@node1 nginx]# mkdir -p /usr/local/nginx/conf.d/
[root@node1 nginx]# vim conf.d/www.myng.com.conf
server {listen 80;server_name www.myng.com;location / {root /code;index index.html;
}
[root@node1 nginx]# mkdir -p /code/{zh,en}[root@node1 nginx]# echo  zh>/code/zh/index.html
[root@node1 nginx]# echo  en>/code/en/index.html
[root@node1 nginx]# echo code>/code/index.html
[root@node1 html]# curl  www.myng.com
code
[root@node1 html]# curl  www.myng.com/en/
en
[root@node1 html]# curl  www.myng.com/zh/   #浏览器里默认加/ 
zhserver {listen 80;server_name www.myng.com.zh  www.myng.com.en;root /code;index index.html;location / {if ($http_host ~* 'zh'){   #$http_host 请求的host的#$http_accept_language  浏览器请求头里的语言标识#$http_user_agent  ~* "iphone|ipad|androaid"   基于agentset $language zh;}if ($http_host ~* 'en'){set $language en;}  rewrite ^/$ http://www.myng.com/$language redirect;}
http://www.myng.com.zh/     --跳转-->  http://www.myng.com/zh/

curl -Lv

[root@node1 html]# curl -Lv  www.myng.com.zh    #会自动重定向后边指定的网址
* About to connect() to www.myng.com.zh port 80 (#0)
*   Trying 192.168.1.11...
* Connected to www.myng.com.zh (192.168.1.11) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.29.0
> Host: www.myng.com.zh
> Accept: */*
>
< HTTP/1.1 302 Moved Temporarily
< Server: nginx/1.22.1
< Date: Sun, 22 Oct 2023 12:53:43 GMT
< Content-Type: text/html
< Content-Length: 145
< Connection: keep-alive
< Location: http://www.myng.com/zh
<
* Ignoring the response-body
* Connection #0 to host www.myng.com.zh left intact
* Issue another request to this URL: 'http://www.myng.com/zh'
* About to connect() to www.myng.com port 80 (#1)
*   Trying 192.168.1.11...
* Connected to www.myng.com (192.168.1.11) port 80 (#1)
> GET /zh HTTP/1.1
> User-Agent: curl/7.29.0
> Host: www.myng.com
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Server: nginx/1.22.1
< Date: Sun, 22 Oct 2023 12:53:43 GMT
< Content-Type: text/html
< Content-Length: 169
< Location: http://www.myng.com/zh/
< Connection: keep-alive
<
* Ignoring the response-body
* Connection #1 to host www.myng.com left intact
* Issue another request to this URL: 'http://www.myng.com/zh/'
* Found bundle for host www.myng.com: 0x2014450
* Re-using existing connection! (#1) with host www.myng.com
* Connected to www.myng.com (192.168.1.11) port 80 (#1)
> GET /zh/ HTTP/1.1
> User-Agent: curl/7.29.0
> Host: www.myng.com
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: nginx/1.22.1
< Date: Sun, 22 Oct 2023 12:53:43 GMT
< Content-Type: text/html
< Content-Length: 3
< Last-Modified: Sun, 22 Oct 2023 11:48:01 GMT
< Connection: keep-alive
< ETag: "65350bf1-3"
< Accept-Ranges: bytes
<
zh
* Connection #1 to host www.myng.com left intact
# 不加-L选项的
[root@node1 html]# curl -v  www.myng.com.zh
* About to connect() to www.myng.com.zh port 80 (#0)
*   Trying 192.168.1.11...
* Connected to www.myng.com.zh (192.168.1.11) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.29.0
> Host: www.myng.com.zh
> Accept: */*
>
< HTTP/1.1 302 Moved Temporarily
< Server: nginx/1.22.1
< Date: Sun, 22 Oct 2023 12:54:30 GMT
< Content-Type: text/html
< Content-Length: 145
< Connection: keep-alive
< Location: http://www.myng.com/zh
<
<html>
<head><title>302 Found</title></head>
<body>
<center><h1>302 Found</h1></center>
<hr><center>nginx/1.22.1</center>
</body>
</html>
* Connection #0 to host www.myng.com.zh left intact

根据浏览器,agent跳转

server {listen 80;server_name www.myng.com.zh  www.myng.com.en;root /code;index index.html;location / {
#场景1: 根据用户浏览器的语言,自动跳转至不同的页面。	if ($http_accept_language ~* 'zh'){   set $language zh;}if ($http_accept_language ~* 'en'){set $language en;}  rewrite ^/$ http://www.myng.com/$language redirect;}#2: 根据用户来源终端设备跳转至不同站点或不同域名if ($http_user_agent  ~* "iphone|ipad|androaid"){rewrite ^/$ http://www.myng.com/m;}#3:传递跳转的uriif ($http_user_agent  ~* "iphone|ipad|androaid"){return 302 http://www.myng.com$request_uri;  #将uri传递}

api地址跳转

#api.myng.com/bbb   www.myng.com/api/bbbserver {listen 80;server_name api.myng.com;if ($http_host ~* (.*)\.(.*)\.(.*)){set $domain $1;}rewrite ^/(.*)$  http://www.myng.com/$domain/$1 last;
}

维护页面

server {listen 80;server_name www.myng.com.zh  www.myng.com.en;root /code;rewrite ^/(.*)$ /wh.html break; #放在server下location / {...

根据状态码跳转

server {listen 80;server_name www.myng.com;root /code;index index.html;
...    error_page   500 502 503 504  =@temp;location @temp {root /data/errorrewrite ^/(.*)$ /wh.html break; #放在server下	}

根据ip区分用户

server {listen 80;server_name www.myng.com;root /code;set $ip 0;if ($remote_addr ~ "10.0.0.1") { #X-Forwarded-For代理ipset $ip 1;}if  ($ip=0){rewrite  ^/(.*)$ /wh.html break; #放在server下}

return 返回跳转

需求: 如果用户请求www.myng.com/test,则返回至ww.xuliangwei.com的urlserver {listen 80;server_name www.myng.com;location / {default_type text/html;# 需要设置--》识别返回字符串if ($request_uri  ~* '^/test'){return 200 "return test";#return 302 http://www.baidu.com;   #302跳转到百度}root /code;index index.html;}
}#浏览器访问:返回
http://www.myng.com/test     return test

last break

当rewrite规则遇到break后,本locationf与其他ocation的所有rewrite/return规则都不再执行。
当rewrite规则遇到last后,本locationh里后续rewrite/return规则不执行,但重写后的url再次从头开始执行所有规则,哪个匹配执行哪个

server {listen 80;server_name www.myng.com;root /code;location / {#http://www.myng.com/1.html    b.htmlrewrite /1.html /2.html;#http://www.myng.com/1.html    2.html#rewrite /1.html /2.html break; #break终止,不再匹配#http://www.myng.com/1.html    a.html #rewrite /1.html /2.html last; #last终止当前location的匹配rewrite /2.html /3.html;}location /2.html {rewrite /2.html /a.html;}location /3.html {rewrite /3.html /b.html;}
}[root@node1 nginx]# echo 1.html>/code/1.html
[root@node1 nginx]# echo 2.html>/code/2.html
[root@node1 nginx]# echo 3.html>/code/3.html
[root@node1 nginx]# echo a.html>/code/a.html
[root@node1 nginx]# echo b.html>/code/b.html

相关文章:

nginx测试rewrite

nginx测试rewrite last :相当于 Apache 里的(L)标记&#xff0c;表示完成rewrite 匹配; break: 本条规则匹配完成后&#xff0c;终止匹配&#xff0c;不再匹配后面的规则。 # 其中last 和 break 用来实现 URL 重写时&#xff0c;浏览器地址栏URL 地址不变 redirect: 返回 302 …...

qt 多语言版本 QLinguist使用方法

在使用qt开发一款软件时&#xff0c;可能需要考虑显示文本中英文等多语言版本。可以使用qt语言家的方式实现。 步骤&#xff1a; 1、代码中给控件设置文本时&#xff0c;记得带上QObject::tr() 2、工程pro文件中加入 TRANSLATIONS demo2_en.ts 3、Qt creator点击“工具”—“外…...

postgresql14-用户与角色(二)

介绍 查看 SELECT rolname FROM pg_roles;postgres是系统初始化时默认创建的角色&#xff0c;为超级管理员。 \duList of rolesRole name | Attributes | Member of ------------------------------------------------------…...

Django结合Celery进行异步调用

目录 Celery介绍 相关环境 相关配置 1、在proj/proj/目录下创建一个新的celery.py模块 定义 Celery 实例&#xff1a; 2、在proj/proj/__init__.py 模块中导入这个应用程序。 3、在各自模块中定义任务文件tasks.py 4、settings.py配置 服务启动 异步调用 Celery介绍 C…...

职场经验|项目管理发展方向有哪些?

很多人都知道项目管理行业发展前景比较好&#xff0c;但都不知道从哪下手&#xff1f;今天胖圆给大家分享一下&#xff0c;想要从事项目管理行业&#xff0c;有哪几种职业方向~ 1. 项目经理&#xff08;Project Manager&#xff09;&#xff1a;负责项目的规划、执行和控制&am…...

Linux的shell(极其粗糙版)

Shell脚本&#xff1a; 脚本主要是为了业务&#xff0c;辅助人工&#xff0c;实现自动化运维 Shell:介于用户和内核之间&#xff0c;充当翻译官的作用&#xff0c;当用户执行相关的命令&#xff0c;shell会把指令二进制传给内核&#xff0c;内核处理完毕以后通过shell把内核的…...

没有英语要求的中国人大女王金融硕士有多香你可能还不知道

在当今全球化的世界中&#xff0c;英语已经成为了一种国际通用语言。对于许多学生来说&#xff0c;掌握英语是实现个人发展和职业成功的关键。尤其是在读研阶段&#xff0c;英语水平的要求更是不容忽视。但现实问题是我们没有相应的语言环境&#xff0c;直接导致的是大学的英语…...

低代码平台如何实现快速开发应用?

目录 一、低代码“快”在哪里&#xff1f; 下面分享低代码低代码平台实现快速开发的一些主要方式&#xff1a; 1.图形化编程&#xff1a; 2.预构建组件&#xff1a; 3.模板和插件&#xff1a; 4.自动化流程&#xff1a; 5.集成和扩展&#xff1a; 6.多端适配&#xff1a; 7.快速…...

iOS原生、Android 原生, flutter 三种方式给照片流添加文字(水印)

效果图:三中代码实现的效果差不多 Swift:代码 import UIKitclass ImageWatermarking: NSObject {static func textToImage(drawText text: String, inImage initImage: UIImage, atPoint point: CGPoint) -> UIImage {let textColor = UIColor.whitelet textFont = UIFon…...

数据结构: 红黑树

目录 1.红黑树概念 2.红黑树性质 3.调整 1.如果p和u都是红色&#xff0c;将其都改为黑色即可,然后向上调整 2.如果p红&#xff08;u黑/u不在&#xff09;&#xff0c;这时候左子树两红&#xff0c;于是给右子树一个红&#xff08;旋转变色&#xff09; 2.1右单旋 变色- …...

如何搭建开源ERP平台Odoo并实现公网远程访问?——“cpolar内网穿透”

文章目录 前言1. 下载安装Odoo&#xff1a;2. 实现公网访问Odoo本地系统&#xff1a;3. 固定域名访问Odoo本地系统 前言 Odoo是全球流行的开源企业管理套件&#xff0c;是一个一站式全功能ERP及电商平台。 开源性质&#xff1a;Odoo是一个开源的ERP软件&#xff0c;这意味着企…...

什么是马尔科夫随机场?

马尔科夫随机场&#xff0c;也称为马尔可夫网&#xff08;Markov Network&#xff09;&#xff0c;是一种概率图模型&#xff0c;用于表示随机变量之间的依赖关系。它是由若干个随机变量组成的无向图&#xff0c;其中节点代表随机变量&#xff0c;边代表它们之间的相互作用或依…...

自然语言处理---huggingface平台使用指南

1 huggingface介绍 Huggingface总部位于纽约&#xff0c;是一家专注于自然语言处理、人工智能和分布式系统的创业公司。他们所提供的聊天机器人技术一直颇受欢迎&#xff0c;但更出名的是他们在NLP开源社区上的贡献。Huggingface一直致力于自然语言处理NLP技术的平民化(democr…...

修炼k8s+flink+hdfs+dlink(六:学习k8s-pod)

一&#xff1a;增&#xff08;创建&#xff09;。 直接进行创建。 kubectl run nginx --imagenginx使用yaml清单方式进行创建。 直接创建方式&#xff0c;并建立pod。 kubectl create deployment my-nginx-deployment --imagenginx:latest 先创建employment&#xff0c;不…...

ARM映像文件组成

引言 ARM编译器将各种源文件&#xff08;汇编文件、C语言程序文件、C语言程序文件&#xff09;编译生成ELF格式的目标文件&#xff08;后缀为.o文件&#xff0c;以下将目标文件简称为.o文件&#xff09;&#xff0c;.o文件经过连接器&#xff0c;和C/C运行时库一起编译生成ELF格…...

redis怎么设计一个高性能hash表

问题 redis 怎么解决的hash冲突问题 &#xff1f;redis 对于扩容rehash有什么优秀的设计&#xff1f; hash 目标是解决hash冲突&#xff0c;那什么是hash冲突呢&#xff1f; 实际上&#xff0c;一个最简单的 Hash 表就是一个数组&#xff0c;数组里的每个元素是一个哈希桶&…...

《软件方法》强化自测题-总纲(6)

DDD领域驱动设计批评文集 做强化自测题获得“软件方法建模师”称号 《软件方法》各章合集 按照业务建模、需求、分析、设计工作流考察&#xff0c;答案不直接给出&#xff0c;可访问自测链接或扫二维码自测&#xff0c;做到全对才能知道答案。 知识点见《软件方法》&#x…...

vue2中,下拉框多选和全选的实现

vue2中&#xff0c;下拉框多选和全选的实现 代码布局在methods: 中添加功能函数较为完整的一个整体代码&#xff1a; 如图所示点击全选即可完成下拉框中全部子项的全部的选中&#xff0c;同时取消全选即可全部取消选择。 代码布局 <div class"chos-box2"><…...

Android-Framework 默认音乐音量最大

代码位置&#xff1a;frameworks/base/services/core/java/com/android/server/audio/AudioService.java -712,6 712,9 public class AudioService extends IAudioService.Stub}} // force music max volume AudioSystem.DEFAULT_STREAM_VOLUME[AudioSystem.STREAM_MUSIC] MA…...

formData对象打印不出来

用el-upload上传图片 以流的形式传给后台 所以用formData对象带数据 let formData new FormData() formData.append(name&#xff0c;monkey7) console.log(formData) 明明已经把数据append进去了 console.log在控制台却打印不出 后来发现他得用formData.get("xxx"…...

wordpress后台更新后 前端没变化的解决方法

使用siteground主机的wordpress网站&#xff0c;会出现更新了网站内容和修改了php模板文件、js文件、css文件、图片文件后&#xff0c;网站没有变化的情况。 不熟悉siteground主机的新手&#xff0c;遇到这个问题&#xff0c;就很抓狂&#xff0c;明明是哪都没操作错误&#x…...

19c补丁后oracle属主变化,导致不能识别磁盘组

补丁后服务器重启&#xff0c;数据库再次无法启动 ORA01017: invalid username/password; logon denied Oracle 19c 在打上 19.23 或以上补丁版本后&#xff0c;存在与用户组权限相关的问题。具体表现为&#xff0c;Oracle 实例的运行用户&#xff08;oracle&#xff09;和集…...

Unity3D中Gfx.WaitForPresent优化方案

前言 在Unity中&#xff0c;Gfx.WaitForPresent占用CPU过高通常表示主线程在等待GPU完成渲染&#xff08;即CPU被阻塞&#xff09;&#xff0c;这表明存在GPU瓶颈或垂直同步/帧率设置问题。以下是系统的优化方案&#xff1a; 对惹&#xff0c;这里有一个游戏开发交流小组&…...

Objective-C常用命名规范总结

【OC】常用命名规范总结 文章目录 【OC】常用命名规范总结1.类名&#xff08;Class Name)2.协议名&#xff08;Protocol Name)3.方法名&#xff08;Method Name)4.属性名&#xff08;Property Name&#xff09;5.局部变量/实例变量&#xff08;Local / Instance Variables&…...

DIY|Mac 搭建 ESP-IDF 开发环境及编译小智 AI

前一阵子在百度 AI 开发者大会上&#xff0c;看到基于小智 AI DIY 玩具的演示&#xff0c;感觉有点意思&#xff0c;想着自己也来试试。 如果只是想烧录现成的固件&#xff0c;乐鑫官方除了提供了 Windows 版本的 Flash 下载工具 之外&#xff0c;还提供了基于网页版的 ESP LA…...

PL0语法,分析器实现!

简介 PL/0 是一种简单的编程语言,通常用于教学编译原理。它的语法结构清晰,功能包括常量定义、变量声明、过程(子程序)定义以及基本的控制结构(如条件语句和循环语句)。 PL/0 语法规范 PL/0 是一种教学用的小型编程语言,由 Niklaus Wirth 设计,用于展示编译原理的核…...

MySQL用户和授权

开放MySQL白名单 可以通过iptables-save命令确认对应客户端ip是否可以访问MySQL服务&#xff1a; test: # iptables-save | grep 3306 -A mp_srv_whitelist -s 172.16.14.102/32 -p tcp -m tcp --dport 3306 -j ACCEPT -A mp_srv_whitelist -s 172.16.4.16/32 -p tcp -m tcp -…...

莫兰迪高级灰总结计划简约商务通用PPT模版

莫兰迪高级灰总结计划简约商务通用PPT模版&#xff0c;莫兰迪调色板清新简约工作汇报PPT模版&#xff0c;莫兰迪时尚风极简设计PPT模版&#xff0c;大学生毕业论文答辩PPT模版&#xff0c;莫兰迪配色总结计划简约商务通用PPT模版&#xff0c;莫兰迪商务汇报PPT模版&#xff0c;…...

Go语言多线程问题

打印零与奇偶数&#xff08;leetcode 1116&#xff09; 方法1&#xff1a;使用互斥锁和条件变量 package mainimport ("fmt""sync" )type ZeroEvenOdd struct {n intzeroMutex sync.MutexevenMutex sync.MutexoddMutex sync.Mutexcurrent int…...

iview框架主题色的应用

1.下载 less要使用3.0.0以下的版本 npm install less2.7.3 npm install less-loader4.0.52./src/config/theme.js文件 module.exports {yellow: {theme-color: #FDCE04},blue: {theme-color: #547CE7} }在sass中使用theme配置的颜色主题&#xff0c;无需引入&#xff0c;直接可…...