今天就跟大家聊聊有關怎么在Nginx中使用codeigniter框架,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結了以下內容,希望大家根據這篇文章可以有所收獲。
1、修改網站配置文件
server {
listen 80;
server_name example.com;//自己的域名
root /alidata/www/example;//網站目錄
index index.php index.htm index.html;
location / {
try_files $uri $uri/ /index.php;
}
location /index.php{
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME /alidata/www/example/index.php;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi.conf;
}
}
2、修改CI 的config.php 文件
$config['base_url'] = 'http://example.com/';
$config['uri_protocol'] = 'PATH_INFO';//貌似REQUEST_URI也行
$config['index_page'] = '';
3、網站根目錄以及以下目錄設置讀寫權限(777)
4、重啟nginx
看完上述內容,你們對怎么在Nginx中使用codeigniter框架有進一步的了解嗎?如果還想了解更多知識或者相關內容,請關注億速云行業資訊頻道,感謝大家的支持。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。