Skip to content

Instantly share code, notes, and snippets.

@samsoir
Forked from shadowhand/vhost.conf
Created November 6, 2009 11:22
Show Gist options
  • Save samsoir/227941 to your computer and use it in GitHub Desktop.
Save samsoir/227941 to your computer and use it in GitHub Desktop.
nginx 1.0.0 config for Debian 6 (Squeeze)
# default server
server {
listen 80;
server_name dev.kohana.framework;
root /mnt/hgfs/Projects/kohana;
access_log /var/log/nginx/dev.kohana.framework.access.log;
error_log /var/log/nginx/dev.kohana.framework.error.log;
location / {
index index.php;
try_files $uri $uri/ index.php$uri @handler;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/www;
}
location /. {
return 404;
}
location @handler {
rewrite / /index.php;
}
location ~ \.php($|/) {
expires off;
set $script index.php;
set $path_info "";
if ($uri ~ "^(.+\.php)(/.*)") {
set $script $1;
set $path_info $2;
}
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_NAME $script;
fastcgi_param SCRITP_FILENAME $document_root/$script;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param PATH_INFO $path_info;
include /etc/nginx/fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment