首页  >  问答  >  正文

php配置

Nginx 如何配置来隐藏public/index.php 入口文件

learnlearn2168 天前1320

全部回复(4)我来回复

  • 胤彬-

    胤彬-2018-10-16 17:46:52

    vhost 配置

    server {

            Listen       80;

          server_name  test.cn ;

            root   "D:ceshi888lhyun";

    include "rewrite/thinkphp.conf";

            索引索引.html 索引.htm 索引。 php;

    #location {

            #    

            #    #autoindex  on;

            #}

            位置 ~ .php(.*)$ {

                fastc gi_pass 127.0.0.1:9000;

                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;

                包括        fastcgi_params ;

            }

    }


    thinkphp.conf

    位置 / {

        if (!-e $request_filename) {

            重写 ^(.*)$ /index.php?s=/$1 最后;

            休息;

      }

    }




    回复
    0
  • 胤彬-

    胤彬-2018-10-16 17:44:58

    回复
    0
  • Justin

    Justin2018-10-13 23:03:49

    thinkphp隐藏index.php

    回复
    0
  • 取消回复