Rewrite对称URL Rewrite,即URL重写,就是把传入Web的请求重定向到其他URL的过程。
if (condition) { … }
if 可以支持如下条件判断匹配符号
~ 正则匹配 (区分大小写)
~* 正则匹配 (不区分大小写)
!~ 正则不匹配 (区分大小写)
!~* 正则不匹配 (不区分大小写)
-f 和!-f 用来判断是否存在文件
-d 和!-d 用来判断是否存在目录
-e 和!-e 用来判断是否存在文件或目录
-x 和!-x 用来判断文件是否可执行
在匹配过程中可以引用一些Nginx的全局变量
$args 请求中的参数;
$document_root 针对当前请求的根路径设置值;
$host 请求信息中的"Host",如果请求中没有Host行,则等于设置的服务器名;
$limit_rate 对连接速率的限制;
$request_method 请求的方法,比如"GET"、"POST"等;
$remote_addr 客户端地址;
$remote_port 客户端端口号;
$remote_user 客户端用户名,认证用;
$request_filename 当前请求的文件路径名(带网站的主目录/usr/local/nginx/html/images /a.jpg)
$request_uri 当前请求的文件路径名(不带网站的主目录/images/a.jpg)
$query_string 与$args相同;
$scheme 用的协议,比如http或者是https
$server_protocol 请求的协议版本,"HTTP/1.0"或"HTTP/1.1";
$server_addr 服务器地址,如果没有用listen指明服务器地址,使用这个变量将发起一次系统调用以取得地址(造成资源浪费);
$server_name 请求到达的服务器名;
$document_uri 与$uri一样,URI地址;
$server_port 请求到达的服务器端口号;
rewrite** 指令根据表达式来重定向URI,或者修改字符串。可以应用于server,location, if
环境下每行rewrite指令最后跟一个flag标记,支持的flag标记有:
last 相当于Apache里的[L]标记,表示完成rewrite。默认为last。
break 本条规则匹配完成后,终止匹配,不再匹配后面的规则
redirect 返回302临时重定向,浏览器地址会显示跳转后的URL地址
permanent 返回301永久重定向,浏览器地址会显示跳转后URL地址
redirect 和 permanent区别则是返回的不同方式的重定向,对于客户端来说一般状态下是没有区别的。而对于搜索引擎,相对来说301的重定向更加友好,如果我们把一个地址采用301跳转方式跳转的话,搜索引擎会把老地址的相关信息带到新地址,同时在搜索引擎索引库中彻底废弃掉原先的老地址。使用302重定向时,搜索引擎(特别是google)有时会查看跳转前后哪个网址更直观,然后决定显示哪个,如果它觉的跳转前的URL更好的话,也许地址栏不会更改。
首先我们需要在windows上进行本地解析,打开C:\Windows\System32\drivers\etc 下面的hosts文件并添加
192.168.13.128 www.testpm.com
[root@localhost ~]# cd /tmp/
[root@localhost tmp]# mkdir a b #创建两个目录
[root@localhost tmp]# echo "111111" >> a/1.html
[root@localhost tmp]# echo "222222" >> b/2.html #创建两个文件并写入数据,以此来区分
# http://www.testpm.com/a/1.html ==> http://www.testpm.com/b/2.html 访问前面的地址,nginx会将你带到后面的地址
[root@localhost tmp]# vim /etc/nginx/conf.d/default.conf
#进入配置文件添清空并添加如下代码
server {
listen 80;
server_name www.testpm.com;
location /a { #如果访问到地址/a这个
root /tmp; #nginx就会去 /tmp/a 这个目录下
index 1.html index.htm; #寻找并读取 1.html或者index.htm文件
rewrite .* /b/2.html permanent; #但是碰到这一行代码后,就不会去读取1.html或者index.htm文件了,而是去匹配/b/2.html(.* 代表所有)
}
location /b { #然后/b符合条件
root /tmp; #去 /tmp/b目录下
index 2.html index.htm; #寻找并读取 2.html或者index.htm文件
}
}
[root@localhost tmp]# nginx -s reload
访问http://www.testpm.com/a
它会自动转向http://www.testpm.com/b/2.html 这个地址
nginx错误页面包括404 403 500 502 503 504等页面,只需要在server中增加以下配置即可:
[root@localhost ~]# vim /etc/nginx/conf.d/default.conf
在server里面添加如下代码
#error_page 404 403 500 502 503 504 /404.html;
location = /404.html {
root /usr/local/nginx/html;
}
注意:
/usr/local/nginx/html/ 路径下必须有404.html这个文件!!!
但是404.html上如果引用其他文件的png或css就会有问题,显示不出来,因为其他文件的访问也要做配置;为了简单,可以将css嵌入文件中,图片用base编码嵌入;如下:
[root@localhost ~]# mkdir -p /usr/local/nginx/html
[root@localhost ~]# vim /usr/local/nginx/html 404.html
#添加如下代码
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<title>404</title>
<style>
.layout-table{display:table;height:100%;width:100%;vertical-align: middle;margin-top:150px}
.layout-table-cell{display: table-cell;vertical-align: middle;text-align:center}
.layout-tip{font-size:28px;color:#373737;margin: 0 auto;margin-top:16px;border-bottom: 1px solid #eee;padding-bottom: 20px;width: 360px;}
#tips{font-size:18px;color:#666666;margin-top:16px;}
</style>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
<div class="layui-body">
<div class="layout-table">
<div class="layout-table-cell">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV4AAACMCAYAAAA0qsGKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkIwRDQ0ODRFMzMyODExRThBQ0Q5Q0UyNkN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,找不到该页面啦!</p>
<p id="tips">请检查您的网络连接是否正常或者输入的网址是否正确</p>
</div>
</div>
</div>
</div>
</body>
</html>
[root@localhost ~]# nginx -s reload
[root@localhost ~]# systemctl stop firewalld && setenforce 0
访问http://192.168.13.128/404.html(ip地址/404.html)
是不是很好看的404页面?