Skip to content

Instantly share code, notes, and snippets.

@wgm89
Created September 12, 2013 08:49
Show Gist options
  • Select an option

  • Save wgm89/6534631 to your computer and use it in GitHub Desktop.

Select an option

Save wgm89/6534631 to your computer and use it in GitHub Desktop.
codeigniter nginx rewrite
server {
listen 8089; ## listen for ipv4; this line is default and implied
#listen [::]:80 default ipv6only=on; ## listen for ipv6
root /var/www/;
index index.php index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
location / {
index index.php;
root /var/www/;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
}
}
location /doc/ {
alias /usr/share/doc/;
autoindex on;
allow 127.0.0.1;
deny all;
}
location ~ /index.php/ {
fastcgi_param SCRIPT_FILENAME /path/to/your/index.php;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_script_name;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment