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. 基于web公交查询系统自我安排进度

    这周完成站点信息管理

  2. IOCP陷阱

    1. AcceptEx 10061 客户端循环连接,没有发送数据,一定次数后,连接失败,WSAGetLastError的结果是10061.并且后续无法再次连接. 这是因为其中的一个参数,详细用法参考I ...

  3. Certification information不能过大

    /* If certification information is too big this event can't be transmitted as it would cause failure ...

  4. 【技术博客】 Laravel 5.1单元测试(PHPUnit)入门

    目录 Laravel 5.1单元测试(PHPUnit)入门 简介 安装与配置 1. 安装 2. 配置 编写测试样例 1. 新建测试样例 2. 编写函数的测试 3. 编写Web功能测试 运行测试与查看结 ...

  5. [Gamma阶段]测试报告

    [Gamma阶段]测试报告 博客目录 测试方法及过程 在正式发布前,为检验后端各接口功能的正确性,后端服务器对压力的耐受程度,以及前端各页面.功能的运行情况,我们对我们的服务器及小程序进行了多种测试. ...

  6. Sourcetree 集成 Azure DevOps Server(Git)

    概述- SourceTree 是 Windows 和Mac OS X 下免费的 Git 和 Hg 客户端管理工具,同时也是Mercurial和Subversion版本控制系统工具.支持创建.克隆.提交 ...

  7. phpcms新建模板页教程

    phpcms新建模板页教程1 直接去template文件夹里的复制的模板页 比方说list1.html2 去后台 界面模板风格 default 默认模板 点击详情列表 找到list1.htm 设置中文 ...

  8. JavaSE 笔试题: 自增变量

    JavaSE 笔试题 自增变量 public class Test { public static void main(String[] args) { int i = 1; i = i++; int ...

  9. Elasticsearch Transport 模块创建及启动分析

    Elasticsearch 通信模块的分析从宏观上介绍了ES Transport模块总体功能,于是就很好奇ElasticSearch是怎么把服务启动起来,以接收Client发送过来的Index索引操作 ...

  10. 适配器(Adapter)模式

    适配器模式把一个类的接口变换成客户端所期待的另一种接口,从而使原本因接口不匹配而无法在一起工作的两个类能够在一起工作. 适配器模式的一些其他名称:变压器模式.转换器模式.包装(Wrapper)模式.适 ...