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

【字号: 日期:2023-11-10浏览:60作者:雯心

问题描述

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

server { listen 8080; server_name localhost localhost; root "E:webphpTS_PLUSpublic"; 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 每次电脑重新启动的时候这行路由配置没有了。怎么个处理法?

问题解答

回答1:

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

相关文章: