加大php文件上传限制三步骤:
1、nginx http参数配置
http {
client_max_body_size 1024m;
client_body_buffer_size 10m;
client_header_timeout 300s;
client_body_timeout 300s;
keepalive_timeout 600;
fastcgi_connect_timeout 600;
fastcgi_send_timeout 600;
fastcgi_read_timeout 600;
fastcgi_buffer_size 256k;
fastcgi_buffers 8 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
}
2、location配置
location ~ /test/ {
proxy_pass https://xxxxx;
include proxy.conf;
}
cat proxy.conf
proxy_connect_timeout 600s;
proxy_send_timeout 900;
proxy_read_timeout 900;
proxy_buffer_size 32k;
proxy_buffers 32 256k;
proxy_busy_buffers_size 512k;
proxy_redirect off;
proxy_hide_header Vary;
proxy_set_header Accept-Encoding '';
proxy_set_header Referer $http_referer;
proxy_set_header Cookie $http_cookie;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
3、php.ini配置
max_execution_time = 600
max_input_time = 600
memory_limit = 448M
post_max_size = 250M
upload_max_filesize = 250M
|