Skip to content
Advertisement

NGINX server configuration for Codeigniter

/etc/nginx/conf.d/default.conf

JavaScript

my codeigniter folder is ‘ci’ which is located in /var/www/html/ci what configuration do I need to work url rewriting?…

Advertisement

Answer

I didn’t want to change the current document root (/var/www/html) since my ‘ci’ folder is located at /var/www/html/ci.

So instead, I created a new location block in /etc/nginx/conf.d/default.conf:

JavaScript

Thanks to Mert Öksüz for suggesting to use try_files $uri $uri/ /ci/index.php?/$request_uri;.

This one also work:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement