Skip to content

Instantly share code, notes, and snippets.

@traeblain
Created June 19, 2012 03:52
Show Gist options
  • Save traeblain/2952214 to your computer and use it in GitHub Desktop.
Save traeblain/2952214 to your computer and use it in GitHub Desktop.
nginx.conf for eli
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
root ../www;
index index.html index.htm index.php;
server {
listen 80 default;
server_name localhost;
root app/webroot;
#root ../www/app/webroot;
#Use the previous line for 'root' if the one I picked doesn't work.
#access_log nginx\logs\access.log;
# Route all requests for PHP files to PHP-fastcgi
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
try_files $uri =404;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location / {
if (-f $request_filename) { # Don't think you need this...
break;
}
if (!-f $request_filename) {
rewrite ^/(.+)$ /index.php?url=$1 last;
break;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment