上传电影失败,413nginx已经设置如下?这nginx.conf该怎么写?
来源:12-4 .流媒体访问限制
ALOH
2017-08-27
worker_processes 1; error_log /usr/local/nginx/logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 1800; client_max_body_size 100m; client_header_timeout 750s; client_body_timeout 750s; proxy_connect_timeout 600s; proxy_read_timeout 750s; proxy_send_timeout 750s; client_body_buffer_size 102400k; limit_conn_zone $binary_remote_addr zone=addr:5m; upstream movie { server 127.0.0.1:5000; } #gzip on; server { listen 80; server_name localhost; client_max_body_size 100m; client_header_timeout 750s; client_body_timeout 750s; proxy_connect_timeout 600s; proxy_read_timeout 750s; proxy_send_timeout 750s; client_body_buffer_size 102400k; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.html index.htm; proxy_pass http://movie; client_max_body_size 100m; proxy_connect_timeout 750s; client_body_buffer_size 102400k; } location ~ \.flv$ { flv; limit_conn addr 4; limit_rate 1024k; rewrite ^/static/uploads/(.+?).flv$ /movie_project/app/static/uploads/$1.flv permanent; } location ~ \.mp4$ { mp4; limit_conn addr 4; limit_rate 1024k; rewrite ^/static/uploads/(.+?).mp4$ /movie_project/app/static/uploads/$1.mp4 permanent; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } }
上传30兆的电影,nginx 出现413 Request Entity Too Large,app
项目设置如下
app.config["MAX_CONTENT_LENGTH"] = 100*1024*1024
写回答
1回答
-
rustgopy
2017-08-28
同学,你好,你的错误可以采用分段排查,你先试下不用nginx反向代理的情况下是否能正常上传,如果能正常上传,然后再检验nginx,nginx下如需上传大文件的话,再加上如下配置:
large_client_header_buffers 语法: large_client_header_buffers number size 默认值:large_client_header_buffers 4 4k/8k
00
相似问题