微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

php – 用于hmvc结构的nginx的Codeigniter设置

任何人都可以使用Nginx为Codemiter设置hmvc结构吗?
请帮我这个,我尝试在Nginx上设置codeigniter HMVC结构.但多次失败.请建议一些配置它的方法.

我使用的是PHP7.0-fpm.

我的Nginx配置文件

server {
listen 80;
root /var/www/html/salsetrack;
index index.html index.htm index.PHP;
server_name local.sales-track.com;

location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
#try_files $uri $uri/ =404;
index index.html index.PHP;
  try_files $uri $uri/ @handler;
  expires 30d;
} 

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

location ~ \.PHP${
try_files $uri =404; 
#Include Nginx’s fastcgi configuration
include /etc/Nginx/fastcgi.conf;
#Look for the FastCGI Process Manager at this location 
fastcgi_pass unix:/run/PHP/PHP7.0-fpm.sock;

include fastcgi_params;
 fastcgi_param PATH_INFO $fastcgi_path_info;
 fastcgi_index index.PHP;
 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

}

location @handler {
      rewrite / /index.PHP;
}}

解决方法:

您可以参考https://www.nginx.com/resources/wiki/start/topics/recipes/codeigniter/获取codeigniter的Nginx配置.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐