记在这里,以后配置起来更方便..![]()
server {
listen 80;
server_name www.yaf.com;
index index.php index.html index.htm;
root /data0/htdocs/www.yaf.com;
location ~ .*\.(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
if (!-e $request_filename) {
rewrite ^/(.*\.(js|ico|gif|jpg|png|css|bmp|html|xls)$) /$1 last;
rewrite ^/(.*) /index.php?$1 last;
}
}
本文详细介绍了Nginx服务器的配置方法,特别是针对PHP请求的处理流程及重写规则的应用。通过具体的配置示例,帮助读者理解如何设置Nginx以高效地处理不同类型的文件请求,并实现将PHP请求转发到指定的FastCGI服务器。
496

被折叠的 条评论
为什么被折叠?



