当前位置:网站首页>III. servername matching rules
III. servername matching rules
2022-06-09 15:23:00 【Little silly bird_ coding】
List of articles
servername A variety of matching methods
ServerName Matching rules
We can have the same servername Configure multiple domain names under the file
1. Complete match
You can directly configure two domain names here , Just visit either of these websites , Back to this video Under the table of contents
server {
listen 80;
server_name xiaodainiao.com xiaodainiao1.com
location / {
root /www/video;
index index.html index.htm;
}
2. Wildcard match
* The number can be any value , except www, There are others ahead , The directories accessed are all video
Be careful : Writing that first will match which one first , If they match, they won't look down .
server {
listen 80;
server_name www.xiaodainiao.com
location / {
root /www/www;
index index.html index.htm;
}
server {
listen 80;
server_name *.xiaodainiao.com
location / {
root /www/video;
index index.html index.htm;
}
3. Wildcard end match
server {
listen 80;
server_name www.xiaodainiao.com // Only visit www.xiaodainiao.com To match this
location / {
root /www/www;
index index.html index.htm;
}
server {
listen 80;
server_name www.xiaodainiao.* // visit www.xiaodainiao.org It will match this after a while
location / {
root /www/video;
index index.html index.htm;
}
4. Regular matching
server {
listen 80;
server_name ~^[0-9]+\.xiaodainiao\.com$;
location / {
root /www/video;
index index.html index.htm;
}
visit :666.xiaodainiao.com It will jump to video below
边栏推荐
- Taoist friends! What is the expiration policy of redis?
- 面积坐标推导三角形常应变单元(CST)
- 百度一程序员被判:不满他人接手项目、彰显自己作用、多次对数据库进行删改,犯破坏计算机信息系统罪
- Triangular constant strain element (CST) derived from area coordinates
- 道友,你都用Redis做啥了?
- After 4 years of experience, I have interviewed 20K test posts. I can't even master basic skills. It's better to recruit fresh students
- 3 tips to crack the flutter productivity you can use immediately!
- ^28JS是单线程的
- mysql 8.0.28安装配置方法图文教程(压缩包方式)
- MySQL数据库用户权限管理
猜你喜欢
随机推荐
135. 分发糖果
Brand renewal, product innovation, marketing innovation, Dongfeng Peugeot's upward road
华为十大发明公布:高效加法网络、多目标博弈智能驾驶获奖
[Typecho blog Xiaobai building tutorial] you are only one step away from having your own blog
mongoose连接多个数据库简单例子
BAT和FAANG的时代翻篇儿了,谁来接棒?
【实战】Redis Cluster(下)-系统版本支持问题
4年经验来面试20K的测试岗,连基本功都不会,还不如去招应届生
GaussDB(DWS)功能及配套工具丨【这次高斯不是数学家】
【云小课】应用平台第43课 云小课带您快速入门多云高可用服务
最成功也最差劲的CEO去世,索尼还是走在他的老路上
Huawei announced its top ten inventions: efficient additive network and multi-objective game intelligent driving
View lazy loading in applet
【实战】基于Chromedriver的应用及爬虫相关
王兴张勇徐雷,谁能问鼎本地电商?
134. 加油站
JS事件流、事件冒泡、阻止冒泡、事件捕获(一看就懂)
详解Seaborn,看这一篇就够了
松下高管:苹果CarPlay不是威胁 而是对自家产品的补充
你好,欢迎访问我的博客
![[paper] cascade r-cnn: delving into high quality object detection](/img/7d/f5ebd89cd8963fe45d4894077ca25b.png)







