當前位置:博客首頁>>建站經(jīng)驗 >> 閱讀正文

yaf框架在nginx中的vhost配置

作者: 鄭曉 分類: 建站經(jīng)驗 發(fā)布于: 2017-07-12 17:31 瀏覽:3,782 沒有評論


記錄一下我在vagrant+puphpet環(huán)境下的yaf框架配置:

server {
listen *:80;
server_name live.dev ;
client_max_body_size 1m;
root /var/www/live/public;
index index.html index.htm index.php;
access_log /var/log/nginx/nxv_4p4tpexsdaaa.access.log;
error_log /var/log/nginx/nxv_4p4tpexsdaaa.error.log;
location ~ \.php$ {
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
}
location / {
autoindex off;
if (!-e $request_filename) {
rewrite ^/(.*) /index.php?$1 last;
}
}
sendfile off;
}

另一種配置參考:

server { listen 80; server_name city.test.com; root "D:/wwwroot/city/webservice/public"; index index.php; location ~ \.php(.*)$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_split_path_info ^(.+?\.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; } location / { if (!-e $request_filename){ rewrite ^/(.*)$ /index.php/$1 last; } }}
? ? ? ?

本文采用知識共享署名-非商業(yè)性使用 3.0 中國大陸許可協(xié)議進行許可,轉載時請注明出處及相應鏈接。

本文永久鏈接: http://www.yjfs.org.cn/yaf-nginx-conf.html

發(fā)表評論

change vcode