server {
listen 80;
server_name phalcon.test.com;
charset utf-8;
index index.php index.html index.htm;
# set $root_path '/usr/share/nginx/falcon/invo/invo/public';
set $root_path '/usr/share/nginx/falcon/invo/test/public';
root $root_path;
#location / {
# try_files $uri $uri/ /index.php;
#}
try_files $uri $uri/ @rewrite;
location @rewrite {
rewrite ^/(.*)$ /index.php?_url=$1;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/falcon/invo/test/public$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root $root_path;
}
location ~ /\.ht {
deny all;
}
}nginx下利用phcalcon生成框架的重写规则
最新推荐文章于 2021-03-18 08:02:11 发布
本文详细介绍了Nginx服务器配置文件的各项设置,包括监听端口、域名指向、字符集、目录路径设定、静态资源处理及PHP请求转发等内容。通过本文可以了解如何高效地配置Nginx以满足Web应用的需求。
2681

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



