server {
listen 80;
server_name ss.test *.ss.test;
root "D:/Project/PHP/admin-h5/dist/";
set $php_root "D:/Project/PHP/admin/src/public/";
set $pic_root "D:/Project/PHP/admin/src/storage/app/"; index index.html index.htm index.php; location / {
expires -1;
index index.html;
try_files $uri /index.html break;
} location ~ /swagger-ui-assets {
index index.php;
try_files $uri $uri/ /index.php?$query_string;
} #location ~ /docs-api {
location ~ /docs-.+$ {
index index.php;
try_files $uri $uri/ /index.php?$query_string;
} location ~ /.+/documentation$ {
index index.php;
try_files $uri $uri/ /index.php?$query_string;
} location ^~ /api {
index index.php;
try_files $uri $uri/ /index.php?$query_string;
} location ~ \.php$ {
root $php_root;
include snippets/fastcgi-php.conf;
fastcgi_pass php_upstream;
#fastcgi_pass unix:/run/php/php7.0-fpm.sock;
} location ^~ /uploads {
root $pic_root;
} charset utf-8; location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
location ~ /\.ht {
deny all;
}
}

  

自定义变量,正则匹配

参考:https://blog.csdn.net/xyang81/article/details/51989079

Nginx Location指令URI匹配规则详解的更多相关文章

  1. Nginx之location 匹配规则详解

    有些童鞋的误区 1. location 的匹配顺序是“先匹配正则,再匹配普通”. 矫正: location 的匹配顺序其实是“先匹配普通,再匹配正则”.我这么说,大家一定会反驳我,因为按“先匹配普通, ...

  2. Nginx 常用全局变量 及Rewrite规则详解

    每次都很容易忘记Nginx的变量,下面列出来了一些常用 $remote_addr //获取客户端ip $binary_remote_addr //客户端ip(二进制) $remote_port //客 ...

  3. Nginx 关于 location 的匹配规则详解

    有些童鞋的误区 1. location 的匹配顺序是“先匹配正则,再匹配普通”. 矫正: location 的匹配顺序其实是“先匹配普通,再匹配正则”.我这么说,大家一定会反驳我,因为按“先匹配普通, ...

  4. Nginx location 匹配规则详解

    语法规则 location [=|~|~*|^~] /uri/ { … } 模式 含义 location = /uri = 表示精确匹配,只有完全匹配上才能生效 location ^~ /uri ^~ ...

  5. nginx配置中location匹配规则详解

    一.概述 nginx官方文档给出location语法如下: 1 location [=|~|~*|^~] uri { … } 其中,方括号中的四种标识符是可选项,用来改变请求字符串和uri的匹配方式. ...

  6. nginx location if 的匹配规则

    cation匹配命令 ~      #波浪线表示执行一个正则匹配,区分大小写~*    #表示执行一个正则匹配,不区分大小写^~    #^~表示普通字符匹配,不是正则匹配.如果该选项匹配,只匹配该选 ...

  7. nginx location标签的匹配规则

    location的匹配 匹配符 匹配规则 优先级 = 精确匹配 1 ^~ 以某个字符串开头 2 ~ 区分大小写的正则匹配 3 ~* 不区分大小写的正则匹配 4 !~ 区分大小写不匹配的正则 5 !~* ...

  8. Nginx location 和 proxy_pass路径配置详解

    目录 一.Nginx location 基本配置 1.1.Nginx 配置文件 1.2 .Python 脚本 二.测试 2.1.测试 location 末尾存在 / 和 proxy_pass末尾存在 ...

  9. nginx location URI匹配规则

    当nginx收到一个请求后,会截取请求的url部份,去搜索所有location指令中定义的URI匹配模式.在server模块中可以定义多个location指令来匹配不同的url请求,多个不同的loca ...

随机推荐

  1. springboot2.x自定义拦截把static静态文件给拦截的坑

    新人新帖,喷后请指正,谢谢 1.王中王,坑中坑 和很多人一样,我在springboo自定义配置登录拦截的时候,写一个WebConfig类继承WebMvcConfigureAdapter,重写AddRe ...

  2. 语法上的小trick

    语法上的小trick 构造函数 虽然不写构造函数也是可以的,但是可能会开翻车,所以还是写上吧.: 提供三种写法: ​ 使用的时候只用: 注意,这里的A[i]=gg(3,3,3)的"gg&qu ...

  3. Python UDP小程序

    为了做UDP的测试,采用了nc和Python的服务器端. nc的安装和使用: yum install -y nc nc -vuz Python的UDP服务器端小程序: # -*- coding: UT ...

  4. ThinkPHP5 使用 JWT 进行加密

    使用 Github 的 firebase\JWT - 使用 Composer 安装此扩展 - 代码示例 <?php /** * [InterCommon-接口公用] * @Author Rain ...

  5. Collection 接口的 toArray 方法

    Collection 接口的 toArray 方法 方法签名 Object[] toArray() 返回包含此 collection 中所有元素的数组. T[] toArray(T[] a) 返回包含 ...

  6. Git flow 工作流与规范

    概述 简版图: PS. 可能用到的命令: 1.从指定 commit拉出新分支   git checkout commitId -b 本地新branchName git checkout 9fbc3d0 ...

  7. [转帖]Linux crontab 查看所有用户的crontab任务

    Linux crontab 查看所有用户的crontab任务 https://www.cnblogs.com/xzlive/p/11542176.html 查看所有用户的crontab任务 - mlz ...

  8. 在vue中导出excel表格

    初学者学习vue开发,想把前端项目中导出Excel表格,查了众多帖子,踩了很多坑,拿出来与大家分享一下经验. 安装依赖 //npm npm install file-saver -S npm inst ...

  9. C#怎么判断字符是不是汉字 汉字和Unicode编码互相转换

    判断一个字符是不是汉字通常有三种方法,第1种用 ASCII 码判断(在 ASCII码表中,英文的范围是0-127,而汉字则是大于127,根据这个范围可以判断),第2种用汉字的 UNICODE 编码范围 ...

  10. 信安周报-第03周:DB系统表

    信安之路 第03周 前言 这周自主研究的任务如下: 任务附录的解释: 文件读写在通过数据库注入漏洞获取webshell的时候很有用 系统库和表存放了很多关键信息,在利用注入漏洞获取更多信息和权限的过程 ...