登录

vhosts.confg的信息不保存的问题

我在开发laravel框架,在vhosts中定义了路由

server {
        listen       8080;
        server_name  localhost localhost;
        root   "E:\web\php\TS_PLUS\public";
        location / {
            try_files $uri $uri/ /index.php?$query_string;
            index  index.html index.htm index.php;
            #autoindex  on;
        }
        location ~ \.php(.*)$ {
            fastcgi_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;
            include        fastcgi_params;
        }
}

加了这行路由代码

try_files $uri $uri/ /index.php?$query_string;

问题是phpstady 每次电脑重新启动的时候这行路由配置没有了。怎么个处理法?

# 网站主机
akram.arkin akram.arkin 2339 天前 977 次浏览

全部回复(2) 我要回复

  • Day

    Day2017-11-02 13:07:22

    phpStudy是按照固定格式读取虚拟域名站点的,分别是域名、路径、二级域名、端口,你自己配置的信息,软件是无法识别,适合新手傻瓜式配置站点,弱国熟悉配置Vhost的文件的话,请手动自己配置,不要使用软件即可,因为手动配置不按照固定格式会导致Nginx无法启动。

    回复
    0
  • 枫林断梦

    知道怎么做了,自己新建一个myvhosts的文件,在nginx.conf里引入就可以了!

    枫林断梦 · 2017-11-03 09:34:59
  • 取消 回复 发送