私はnginxアップロードモジュールを使用せずにうまく動作するnginxの優れた仮想ホストを持っています。
このアップロードリクエストにアップロードの進行状況を追加すると、どうすれば解決できますか?/?r=upload
または/upload?foo=bar
を使用してファイルをアップロードし、/progress
その他を使用してアップロードの進行状況データを追跡する必要があります。
# static9-localhost.sweb
server {
# upload limit
# upload_limit_rate 10240;
# request size limitation
client_max_body_size 500m;
client_body_buffer_size 64k;
# document root
root /path/to/webapp/static/public/;
# index file
index index.php;
# server name
server_name static9-localhost.sweb;
# rewrite rules
rewrite "^/thumbnail/([A-Za-z0-9]{12})/(.*)/.*$" /index.php?r=thb&unique=$1&prm=$2 last;
# /
location @frontcontroller {
# expires
expires max;
# disable etag
if_modified_since off;
add_header 'Last-Modified' '';
# mvc rewrite
try_files $uri $uri/ /index.php?$uri&$args;
}
# upload progress
location /upload {
upload_pass @frontcontroller;
track_uploads proxied 600s;
}
# progress
location = /progress {
report_uploads proxied;
}
# error pages
error_page 404 /index.php?r=404;
error_page 403 /index.php?r=403;
error_page 500 501 502 503 504 /index.php?r=500;
# php5-fpm
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9003;
fastcgi_index index.php;
fastcgi_read_timeout 300;
include fastcgi_params;
}
# logs
access_log /path/to/webapp/logs/static_access.log;
error_log /path/to/webapp/logs/static_error.log;
}
上記の仮想ホストの場合、アップロード要求が/upload/?X-Progress-ID=QLiFKnG5A81K
フリーズします。何が問題ですか?
/?r=blahblah
アップロードファイルを/upload
使用してを送信する場合にもうまく機能するなどのリクエストが必要/?r=upload
です。
upload_progress <zone_name> <zone_size>
上のディレクティブが欠落していると思います。location /upload