簡體   English   中英

nginx服務Django | 502錯誤的網關

[英]nginx serving Django | 502 Bad Gateway

我正在嘗試提出一個大要求,如何使用Django nginx生成pdf,這是我的nginx.conf:

我認為這個要求不高。

我該怎么做才能增加服務器的請求?

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;
    }

}

謝謝..

不要繼續增加超時時間,從長遠來看,這不會對您有幫助。

而是使用celerypython-rq將長時間運行的任務發送到后台,並立即返回響應。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM