记录一下我在vagrant+puphpet环境下的yaf框架配置:
<br />
server {<br />
listen *:80;<br />
server_name live.dev ;<br />
client_max_body_size 1m;<br />
root /var/www/live/public;<br />
index index.html index.htm index.php;<br />
access_log /var/log/nginx/nxv_4p4tpexsdaaa.access.log;<br />
error_log /var/log/nginx/nxv_4p4tpexsdaaa.error.log;<br />
location ~ \.php$ {<br />
fastcgi_index index.php;<br />
include /etc/nginx/fastcgi_params;<br />
fastcgi_pass 127.0.0.1:9000;<br />
}<br />
location / {<br />
autoindex off;<br />
if (!-e $request_filename) {<br />
rewrite ^/(.*) /index.php?$1 last;<br />
}<br />
}<br />
sendfile off;<br />
}<br />
另一种配置参考:
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;
}
}
}
本文链接:https://my.lmcjl.com/post/29.html
4 评论