再次优化NGINX+php-fpm上传
nginx $> vim nginx.conf user www www;worker_processes1;
error_loglogs/error.log notice;
pid logs/nginx.pid;
working_directory /usr/local/nginx;
worker_rlimit_nofile 65535;
events {
use epoll;
worker_connections1024;
}
http {
include mime.types;
default_typeapplication/octet-stream;
client_max_body_size 1024m;
server {
listen 80;
server_name 192.168.6.162;
index index.html index.htm index.php;
root /var/www;
# Upload form should be submitted to this location
location /upload {
# Pass> upload_pass /upload.php;
# Store files to this directory
# The directory is hashed, subdirectories 0 1 2 3 4 5 6 7 8 9 should exist
upload_store /var/www/webdata;
# Allow uploaded files to be read only by user
upload_store_access user:r;
# 限制上传速度
upload_limit_rate 128k;
# Set specified fields in request body
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;
# Inform backend about hash and> 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$";
}
# Pass> location ~ \.php {
fastcgi_pass127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
}
}
页:
[1]