user www;
worker_processes 8;
error_log logs/error.log;
error_log logs/error.log notice;
error_log logs/error.log info;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format access '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"';
access_log logs/access.log access;
sendfile on;
keepalive_timeout 65;
server {
client_max_body_size 100m;
listen 80;
server_name localhost;
root /usr/local/www;
location / {
root html;
index index.html index.htm;
}
location ~* \.(js|jpg|png|css|jpeg|gif|bmp) {
expires 30d;
}
location /upload {
upload_pass /upload.php;
upload_store /usr/local/www/static;
upload_store_access user:rw;
upload_state_store /usr/local/www/static/state ;
upload_set_form_field "${upload_field_name}_name" $upload_file_name;
upload_set_form_field "${upload_field_name}_content_type" $upload_content_type;
upload_set_form_field "${upload_field_name}_path" $upload_tmp_path;
upload_aggregate_form_field "${upload_field_name}_md5" $upload_file_md5;
upload_aggregate_form_field "${upload_field_name}_size" $upload_file_size;
upload_pass_form_field "^submit$|^description$";
upload_cleanup 400 404 499 500-505;
}
location ~ .*\.(php|php5)?$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}