2014-05-22 155 views
0

我想提出一個大的請求,如何使用Django nginx生成pdf,下面是我的nginx.conf:nginx服務Django | 502錯誤的網關

我覺得這個請求不高。

我能做些什麼來增加服務器的這個請求?

server { 
    server_name .urbanarts.com.br; 
    client_max_body_size 10M; 
    client_body_timeout 10; 
    client_header_timeout 10; 
    keepalive_timeout  15; 
    send_timeout   10; 
    rewrite^https://urbanarts.com.br$request_uri? permanent; 

    location /static { 
     autoindex on; 
     alias /srv/www/urbanarts/project/urbanarts_cloud/app/static; 
     log_not_found on; 
    } 

    location/{ 
     proxy_redirect  off; 
     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-Protocol $scheme; 
     proxy_pass   http://127.0.0.1:8007/; 
    } 

    location /robots.txt { 
     root   /srv/www/urbanarts/project/urbanarts_cloud/app/static; 
     access_log  off; 
     log_not_found off; 
    } 

    location /favicon.ico { 
     root    /srv/www/urbanarts/project/teste/urbanarts_cloud/static/images; 
     access_log  off; 
     log_not_found off; 
    } 

} 

謝謝..

+0

您可以使用芹菜來請求啓動後臺進程,並在用戶完成時返回一個URL。 –

+0

我想你可能會把'502'錯誤代碼與'413'混淆。這很可能與PDF文件的大小無關。 – Matt

回答

0

不停止增加的時間,這是不會幫助你從長遠來看。

改爲使用celerypython-rq將長時間運行的任務發送到後臺並立即返回響應。