你是直接是java前面没有代理的话应该是java 超时了,你配置一下超时时间 URL url = new URL(fileUrl); URLConnection connection = url.openConnection(); // 设置连接超时时间为60秒 connection.setConnectTimeout(60000); ..... 如果还有nginx就这样配置一下 location /api { proxy_pass http://127.0.0.1:5000; # nginx跟后端服务器连接超时时间 proxy_connect_timeout 300; # 后端服务器数据回传超时时间 proxy_send_timeout 300; # 连接成功后,后端服务器响应超时时间 proxy_read_timeout 300; proxy_set_header Host $host:$server_port; }