Skip to content

Instantly share code, notes, and snippets.

@outman
Created September 12, 2012 13:56
Show Gist options
  • Save outman/3706765 to your computer and use it in GitHub Desktop.
Save outman/3706765 to your computer and use it in GitHub Desktop.
nginx for CodeIgniter rewrite
server {
listen 80;
server_name mrkt.com;
access_log /var/www/html/logs/mrkt.access.log main;
error_log /var/www/html/logs/mrkt.error.log;
location / {
root /var/www/html/mrkt;
index index.html index.htm index.php;
if (-f $request_filename) {
expires 30d;
break;
}
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?$1 last;
break;
}
}
location ~ \.php$ {
root /var/www/html/mrkt;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment