zoukankan      html  css  js  c++  java
  • nginx匹配以XXX结尾的

    匹配以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

  • 相关阅读:
    kicad 基本操作
    RedHat centos中的上传下推脚本
    使用Node.js爬虫存储MySQL数据库
    解决vue和vue-template-compiler版本不同报错的问题
    Vue组件通信(父子组件通信)-学习笔记
    git 简单操作
    错误解决:redis.exceptions.ResponseError: unknown command 'SENTINEL'
    nginx做泛域名解析的域名的正则判断
    postman对字符串进行base64编码方法和变量的使用
    pymysql报错OperationalError: (2013, 'Lost connection to MySQL server during query')
  • 原文地址:https://www.cnblogs.com/xingyunfashi/p/11231366.html
Copyright © 2011-2022 走看看