zoukankan      html  css  js  c++  java
  • Nginx Location指令URI匹配规则详解

    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

  • 相关阅读:
    std::string构造函数
    shell命令-while语句
    shell命令-for语句
    shell命令-if语句
    softmax回归推导
    sigmod函数求导
    生成器面试题之一
    range和xrange的区别
    python里的input
    python中print和input的底层实现
  • 原文地址:https://www.cnblogs.com/cxscode/p/11188189.html
Copyright © 2011-2022 走看看