zoukankan      html  css  js  c++  java
  • nginx配置

    1、nginx隐藏index.php

      下面是虚拟主机隐藏index.php的一个案例,其中红色的就是隐藏index.php

    server {
            listen       80;
            server_name  www.sand.com alias sand.com;
            location / {
                root   D:/sandbox_pro/sandbox;
                if ( -f  $request_filename/index.php) {
                    rewrite (.*) $1/index.php;
            }
    
            if ( !-f $request_filename )  {
                    rewrite (.*) /index.php;
            }
                index  index.html index.htm default.html default.htm index.php default.php app.php u.php;
                include        D:/sandbox_pro/sandbox/up-*.conf;
            }
            autoindex off;
            include advanced_settings.conf;
            location ~ ^.+.php {
                root          D:/sandbox_pro/sandbox;
                fastcgi_pass   bakend;
                fastcgi_index  index.php;
                fastcgi_split_path_info ^((?U).+.php)(/?.+)$;
                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                fastcgi_param  PATH_INFO $fastcgi_path_info;
                fastcgi_param  PATH_TRANSLATED $document_root$fastcgi_path_info;
                include        fastcgi.conf;
            }
            }
    #server www.sand.com end}
  • 相关阅读:
    macOS 修改键盘重复按键延迟
    stdout 与 stderr 区别
    E. 1-Trees and Queries
    Codeforces Round #615 (Div. 3)
    Codeforces Round 613(div 2)
    Codeforces Edu80
    SPOJ
    快读
    《货车运输》题解--最大生成树&倍增
    倍增思想求lca
  • 原文地址:https://www.cnblogs.com/webclz/p/4155964.html
Copyright © 2011-2022 走看看