0

I deployed a deep learning model api in the ec2 ubuntu server. And I using the following command to send my json files.:

curl http://ccc/api/ -d '{"image_link":["https://xx/8/52i_b403bb15-0637-4a17-be09-476168ff9a73"], "bb":"100"}' -H 'Content-Type: application/json' 

Since the predicting model takes about 5 minutes to complete prediction. If I just predict some labels(1 labels) not whole labels(10 labels), the response result is OK. If want to predict the whole labels, and the error is out

<head><title>504 Gateway Time-out</title></head>
<body bgcolor="white">
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx/1.14.0 (Ubuntu)</center>
</body>
</html>

and My Ngnix.conf:

user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
        worker_connections 768;
        # multi_accept on;
}

http {

        ##
        # Basic Settings
        ##

        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 900;
        types_hash_max_size 2048;
        # server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
        # SSL Settings
        ##

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
        ssl_prefer_server_ciphers on;

        ##
        # Logging Settings
        ##

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

and I also set the default file in sites-enable:

 server {
        listen 80;                   # listen gate
        server_name xxx; # aws IP or domain name
        charset      utf-8;
        client_max_body_size 75M;
        fastcgi_read_timeout 1200;
        location / {
            include uwsgi_params;         # import uwsgi
            uwsgi_pass 127.0.0.1:8000;    #
            uwsgi_param UWSGI_PYTHON /usr/bin/python3;       # Python environment)
            uwsgi_param UWSGI_CHDIR /home/ubuntu/xxxx/src;             # project dir
            uwsgi_param UWSGI_SCRIPT app:app;             # main app
        }
    }
tktktk0711
  • 1,656
  • 7
  • 32
  • 59
  • Possible duplicate of [Nginx reverse proxy causing 504 Gateway Timeout](https://stackoverflow.com/questions/24453388/nginx-reverse-proxy-causing-504-gateway-timeout) – Matus Dubrava Jul 09 '19 at 10:32
  • I don't why it is duplicate since I used nginx and uwsgi to deploy flask app in aws. – tktktk0711 Jul 10 '19 at 02:02
  • You just abuse your power to others question. the duplicate question you think it is same, why it is same, please give your reason. I will contact the stackoverflow. – tktktk0711 Jul 10 '19 at 02:05
  • I have solved my questions based on my survey. And the question you think it is duplicate is not helpful to my question. – tktktk0711 Jul 10 '19 at 05:28

0 Answers0