An open API service indexing awesome lists of open source software.

https://github.com/ashishtiwari1993/nginx-codeigniter-setup-ubuntu

Nginx CodeIgniter setup
https://github.com/ashishtiwari1993/nginx-codeigniter-setup-ubuntu

ci nginx nginx-ci-setup nginx-codeigniter

Last synced: 12 months ago
JSON representation

Nginx CodeIgniter setup

Awesome Lists containing this project

README

          

# nginx codeigniter setup ubuntu

ubuntu 16.xx, 14.xx, CodeIgniter 3.x.x

Step1: Install Nginx with following commands.

sudo apt-get update
sudo apt-get install nginx

Step2: Download CodeIgniter latest version from here https://codeigniter.com/download .

Step3: Extract CodeIgniter and place it here '/var/www/html/ci' .

Step4: Go to `cd /etc/nginx/sites-available/` .

Step5: Create file with your domain name like 'yourdomain.com' and copy below content. Replace your domain name.

server {
listen 80;
listen [::]:80;

root /var/www/html/ci;

autoindex on;
index index.php index.html index.htm index.nginx-debian.html;

server_name yourdomain.com;

location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php;
}

location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}

location ~ /\.ht {
deny all;
}
}

Step7: Open ```/etc/nginx/nginx.conf``` . Add ```include /etc/nginx/sites-available/*``` under ```http{...}``` block.

Step8: Complie nginx with ```sudo nginx -t```.

Step9: Restart your Nginx server with ```systemctl restart nginx.service``` and hit ```yourdomain.com``` in browser. You should able to see codeIgniter index page.