繁体   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