Codeigniter nginx configuration in PHP 7.1 on Ubuntu server

I assume you have already nginx on your computer or server. And this is the configuration for your codeigniter application. This is the nginx configuration for your application.

server {
listen 8890;
server_name localhost;
root /usr/share/nginx/html/simpad;
autoindex on;
index index.php;

error_log /var/log/nginx/simpad-error.log;

location / {

try_files $uri $uri/ /index.php;

location = /index.php {

fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/ci$fastcgi_script_name;
include fastcgi_params;
fastcgi_buffers 256 16k;
fastcgi_buffer_size 128k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;

location ~ \.php$ {
return 444;

And then Restart your nginx : /etc/init.d/nginx restart.

Open your Codeigniter application configuration file on : application/config/config.php for update some configuration.

Change this configuration like this code :

$config[‘base_url’] = “”;

$config[‘index_page’] = “”;

And then run your codeigniter application on your browser.

if you have an error like this : Only variables should be assigned by reference on Loader.php on your codeigniter core you must open file on system/core/Common.php and change like this code :

function &is_loaded($class = ”)

If you have a question about the configuration please leave your comment.

Thank you