情况:媒体服务器上传小文件没问题,大一点的文件报这个错误。
原因:这是因为nginx限制了请求体大小
方案:需要在nginx的虚拟机配置文件中添加:
client_max_body_size 50m;
server{ listen 80; server_name jesus.weyomusic.com; location / { 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; proxy_pass http://ip:81; } } server{ listen 80; server_name weyomusic.com www.weyomusic.com; location / { 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; proxy_pass http://ip:81; client_max_body_size 50M; } }