After much study / struggle, I was able to configure nginx for codeigniter. I need to clear one last hurdle with phpmyadmin to reach level 4 of nginx config game.
Here's the nginx.conf for my website:
location / {
try_files $uri $uri/ @codeigniter;
}
location @codeigniter {
rewrite ^(.*) /index.php?$1 last;
}
location ~ \.php$ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/php-fastcgi/php-fastcgi.socket;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/example.com/html/index.php;
}
A bit of explanation: I am using nginx as replacement for apache. I have a symlink to phpmyadmin under /var/www/example.com/html/ folder. Codeigniter requires that SCRIPT_FILENAME point to codeigniter's index.php. Since all php requests are routed through codeiginiter, the try_files fails for phymyadmin. How do I overcome this?