我在開發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 每次電腦重新啟動的時候這行路由配置沒有了。怎麼個處理法?
Day2017-11-02 13:07:22
phpStudy是按照固定格式讀取虛擬域名站點的,分別是域名、路徑、二級域名、端口,你自己配置的信息,軟體是無法識別,適合新手傻瓜式配置站點,弱國熟悉配置Vhost的檔案的話,請手動自行配置,不要使用軟體即可,因為手動配置不按照固定格式會導致Nginx無法啟動。