Report this

What is the reason for this report?

Error 404 with Codeigniter

Posted on September 18, 2015

Hi, I have recently setup my Droplet with Ubuntu (and nginx), i am currently trying to install Codeigniter and it loaded the Welcome page just fine. However once i deployed my project (which runs well on a local xampp installation) to the server i keep getting 404 errors. This happens when loading the index page as well as any other page. Here is my config:

server {

server_name example.com;

root /usr/share/nginx/project;

index index.html index.php index.htm;

# set expiration of assets to MAX for caching
location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
    expires max;
    log_not_found off;
}
location / {
    # Check if a file exists, or route it to index.php.
    try_files $uri $uri/ /index.php;
}

location ~* \.php$ {

fastcgi_pass 127.0.0.1:9000;

    fastcgi_index index.php;
    fastcgi_split_path_info ^(.+\.php)(.*)$;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
 }

}

Any help would be greatly appreciated!

Thank you



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi,

Please refer to this error guide for Codeignitor - https://ellislab.com/codeigniter/user-guide/general/errors.html

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.