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. TensorFlow实现文本情感分析详解

    http://c.biancheng.net/view/1938.html 前面我们介绍了如何将卷积网络应用于图像.本节将把相似的想法应用于文本. 文本和图像有什么共同之处?乍一看很少.但是,如果将句 ...

  2. CSS 分割线

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  3. dockerfile 的问题 FROM alpine:3.8 temporary error (try again later)

    FROM alpine:3.8 apk add xxx安装软件 fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX ...

  4. 配置tomcat服务器内存大小中的Xms、Xmx、PermSize、MaxPermSize 详解

    1.参数的含义 -vmargs -Xms256m -Xmx512m -XX:PermSize=256M -XX:MaxPermSize=512M -vmargs 说明后面是VM的参数,所以后面的其实都 ...

  5. docker Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post

    利用docker构建时,报错 + docker pull maven:3-alpine Got permission denied while trying to connect to the Doc ...

  6. c++ rvo vs std::move

    c++ rvo vs std::move To summarize, RVO is a compiler optimization technique, while std::move is just ...

  7. python三级联动

    #以字典的形式 保存相关省市数据 menu={ '北京':{ '朝阳':{ '国贸':{ 'CICC':{}, 'HP':{}, '银行':{}, 'CCTV':{} }, '望京':{ '陌陌':{ ...

  8. 什么是 ZFS文件系统?ZFS概念及特点简介

    什么是 ZFS? ZFS(Zettabyte File System)是由SUN公司的Jeff Bonwick领导设计的一种基于Solaris的文件系统,最初发布于20014年9月14日. SUN被O ...

  9. Java8 新特性 函数式接口

    什么是函数式接口   函数式接口是Java8引用的一个新特性,是一种特殊的接口:SAM类型的接口(Single Abstract Method).但是它还是一个接口,只是有些特殊罢了.  函数式接口的 ...

  10. Collection 接口的 toArray 方法

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