匹配以do结尾的所有文件;如http://192.168.126.168:8080/delivery/transportPlanData.do?startRelease=2019-07-06&endRelease=2019-07-06&_search=false&nd=1562309595650&rows=20&page=1&sidx=&sord=asc&kunna=&bezei=&vtext=

server {
    listen       8888;
    server_name  localhost;

# charset koi8-r;
    access_log  logs/bbb.access.log  main;
    error_log   logs/bbb.error.log;

location /jing {
        alias  /usr/share/nginx/html;
        index  index.html index.htm;
    }

location ~*\.(do)$ {
                 proxy_redirect off;
                 proxy_set_header  Host  $host;
                 proxy_set_header  X-Real-IP  $remote_addr;
                 proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;
                 proxy_pass http://192.168.126.168:8080;
   }
}

location / {
                        try_files $uri @apache;
                        }
#所有的路径都是/开头,表示匹配所有
                location @apache {
                        internal;
                        proxy_pass http://127.0.0.1:1080;
                        include proxy.conf;
                        }
#url重定向至@apache规则
                location ~ .*\.(php|php5)?$
                        {
                                proxy_pass http://127.0.0.1:1080;
                                include proxy.conf;
                        }
#匹配所有以.php或者.php5的URL, ~表示区分大小写
                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                                expires      30d;
                        }
#匹配以.gif,.jpg,.jpeg,.png,.bmp,.swf结尾的url
                location ~ .*\.(js|css)?$
                        {
                                expires      12h;
                        }
#匹配以.js或者.css结尾的url

nginx匹配以XXX结尾的的更多相关文章

  1. nginx 匹配.zip .apk 结尾的文件 直接下载

    server { listen 80; server_name ok.xidd.com; index index.html index.htm index.php; root /alidata/www ...

  2. python3.4学习笔记(十二) python正则表达式的使用,使用pyspider匹配输出带.html结尾的URL

    python3.4学习笔记(十二) python正则表达式的使用,使用pyspider匹配输出带.html结尾的URL实战例子:使用pyspider匹配输出带.html结尾的URL:@config(a ...

  3. nginx: [emerg] unknown directive “ ” in /usr/local/nginx/conf/vhost/XXX.conf:53报错处理

    开发同事发给我一小段nginx配置,加到服务器上之后,执行nginx -s reload时,出现报错: nginx: [emerg] unknown directive “ ” in /usr/loc ...

  4. 一个nginx匹配很诡异的问题

    nginx配置如下: location ~ \.php$ { root /opt/nginx/html; fastcgi_pass 127.0.0.1:9000; fastcgi_index inde ...

  5. Linux统计文件/目录数量ls -l | grep "^-" | wc -l匹配开头和结尾

    Linux统计文件数量 ls -l | grep "^-" | wc -l “^-”  一般文件 “^d” 目录文件 shell/vim中^表示开头 cat repatterns ...

  6. nginx匹配规则说明以及匹配的优先级

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

  7. nginx 匹配规则小总结

    nginx location 等号类型(=)的优先级最高,需要精确匹配.一旦匹配成功,则不再查找其他匹配项. ^~类型表达式.一旦匹配成功,则不再查找其他匹配项. 正则表达式类型(~ ~*)的优先级次 ...

  8. nginx 匹配路由分发php和golang

    大概这么个形式,可以走通 server { listen ; server_name localhost; root "E:/wwwroot180/public"; # 匹配指定路 ...

  9. Nginx 匹配流程一览

    在 nginx server 模块中,location 的定义长被用来匹配一个标准的 URI, 并根据 URI 的不同做出相应的服务方案. nginx location 匹配的优先级 在 locati ...

随机推荐

  1. C中整数的溢出

    /** * 整数的溢出 */ #include <stdio.h> int main(int argc, char *argv[]) { short i = -24; // 将-24以无符 ...

  2. Ansible--06 ansible roles

    Ansible roles roles不管是Ansible还是saltstack,我在写一键部署的时候,都不可能把所有的步骤全部写入到一个'剧本'文件当中,我们肯定需要把不同的工作模块,拆分开来,解耦 ...

  3. jQuery 菜单 垂直菜单实现

    HTML <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <ti ...

  4. 【串线篇】浅谈BeanFactory

    BeanFactory&ApplicationContext BeanFactory: bean工厂接口,负责创建bean实例, 容器里保存的所有单例bean其实是一个map<key-- ...

  5. jenkins发送邮箱配置,出现Error sending to the following VALID addresses,解决方案

    Jenkins发送邮箱配置,需要的插件:Extended E-mail Notification,邮件通知 1.Manage Jenkins -> Configure System 2.下图是“ ...

  6. Qt Unknown module(s) in QT: webengine

    到今天位置好像Qt 出到了5.10还是5.9.x吧,本身是用MSVC 5.7.0本身就有支持 webengine这个模块 然后跟风升级了5.9.1,公司项目不用qt框架了用VC渣渣6.0.....然后 ...

  7. elementui中table组件表头和内容不对齐的问题

    表头与内容没对齐 在样式里加入 .el-table th.gutter{ display: table-cell!important; } 终于舒服了

  8. 人生苦短_我用Python_list(列表)_002

    # coding=utf-8 # 列表 list 列表函数 # 列表的特性: 可以有任何类型的值 可以更改 # 可以更改.增加.删除.修改 # 增加 append 直接在尾巴增加 list_1 = [ ...

  9. hdu1059&poj1014 Dividing (dp,多重背包的二分优化)

    Problem Description Marsha and Bill own a collection of marbles. They want to split the collection a ...

  10. zabbix 如何监控php-fpm?

    zabbix监控php-fpm主要是通过nginx配置php-fpm的状态输出页面,在正则取值.要nginx能输出php-fpm的状态首先要先修改php-fpm的配置,没有开启nginx是没有法输出p ...