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
- Host: GitHub
- URL: https://github.com/ashishtiwari1993/nginx-codeigniter-setup-ubuntu
- Owner: ashishtiwari1993
- Created: 2017-05-20T05:03:38.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-09-27T08:35:36.000Z (over 7 years ago)
- Last Synced: 2025-03-11T16:49:49.241Z (over 1 year ago)
- Topics: ci, nginx, nginx-ci-setup, nginx-codeigniter
- Language: DIGITAL Command Language
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.