推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
longmeier90
V2EX  ›  Python

请教一个 nginx 请求方面的问题

  •  
  •   longmeier90 · Jun 22, 2021 · 2274 views
    This topic created in 1922 days ago, the information mentioned may be changed or developed.

    我用 gunicorn+django 部署了一个项目。前端页面调接口 nginx 提示 error:

    [alert] 8#8: *12811 zero size buf in writer t:1 r:1 f:0 000056152536F2F0 000056152536F2F0-000056152536F2F0 0000000000000000 0-0 while sending to client
    

    nginx 配置如下:

       ssl_certificate   conf.d/letsencrypt/3481255__bolineyecare.com.pem;
        ssl_certificate_key  conf.d/letsencrypt/3481255__bolineyecare.com.key;
        ssl_session_timeout 5m;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
        charset utf-8;
        expires +0d;
        add_header Pragma "no-cache";
    
        root  /usr/share/nginx/html/collets_web/dist;
        client_max_body_size    2000m;
        client_body_buffer_size 2000m;
        proxy_read_timeout  20m;
    
        gzip on;
        gzip_min_length 4k;
        gzip_buffers 4 16k;
        gzip_comp_level 6;
        gzip_types text/plain application/x-javascript text/css application/xml application/javascript application/json;
        gzip_vary on;
        gzip_http_version 1.1;
    
       # rewrite ^/$ /admin/ last;
        location /api/purchasing/ {
           proxy_pass    http://127.0.0.1:9527/api/purchasing/;
            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;
            add_header    Cache-Control no-store;
            client_max_body_size    2000m;
        }
    

    这两天 baidu 、google 都还没有找到问题。有一种说法是数据的问题。

    3 replies  •  2021-06-22 18:55:29 +08:00
    longmeier90
        3
    longmeier90  
    OP
       Jun 22, 2021
    @hymzhek 多谢提醒。我把 docker 里面的 nginx 版本 1.17.2 换成 1.17.3 就好了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   841 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 20:48 · PVG 04:48 · LAX 13:48 · JFK 16:48
    ♥ Do have faith in what you're doing.