使用nginx配置Codeigniter HMVC结构

4

有人完成了 Codeigniter使用nginx配置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;
}}

你的服务器操作系统是什么?CentOS吗? - Rejoanul Alam
不是。它是Ubuntu。 - Deepak Shinde
你是否注意到第三行代码中有个错别字? root /var/www/html/ salsetrack; - İlker Ergün
1个回答

0

抱歉朋友们,这是Codeigniter会话的问题。感谢您的回复。 - Deepak Shinde

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接