无法使用uWSGI和Nginx将多个curl请求发布到Django端点

时间:2019-09-05 08:37:43

标签: django nginx curl uwsgi

我无法向django端点发送多个curl请求。处理单个请求,但满足多个curl请求,但出现500错误。需要帮助!

nginx / sites-enabled / uvlearn.conf:

upstream django {
server unix://home/clyde/Downloads/automatic_annotator_tool/django_app/socket_101.sock;
keepalive 32;
}
server {
listen 8000;
server_name #; # substitute your machine's IP address or FQDN
charset utf-8;

client_max_body_size 75M;   # adjust to taste

location /static {
    alias /home/clyde/Downloads/automatic_annotator_tool/django_app/static; # your Django project's static files - amend as required
}


location / {
    uwsgi_pass  django;
    include     /etc/uwsgi/sites/uwsgi_params; # the uwsgi_params file you installedi
    proxy_read_timeout     300;
    proxy_connect_timeout  300;
    proxy_http_version 1.1;
    proxy_set_header Connection "";
    keepalive_requests 100;
}


location /queried_data {

alias  /home/clyde/Downloads/automatic_annotator_tool/data/queried_data;

}

location /upload_data {
    alias  /home/clyde/Downloads/automatic_annotator_tool/data/upload_data;
}
location /nginx_status {
    stub_status on;
} 

}`



I am able to send a single curl command using:
```curl -X POST -H "Content-Type: application/json" -d '@8_19_35am_1566893975637_1.json' http://13.232.246.51:8000/search/upload_rtsp/```

But when I send multiple curl commands using:
```curl -X POST -H "Content-Type: application/json" -d '@8_19_35am_1566893975637_1.json' -d '@8_19_35am_1566893975638_1.json' http://13.232.246.51:8000/search/upload_rtsp/

我收到服务器500错误。我检查了Nginx访问日志和错误日志。我所看到的是,发出多个请求时记录了500个错误,而发出单个请求时记录了200个通行证。

我应该添加哪些控件来实现多个请求?

0 个答案:

没有答案