V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
python30
V2EX  ›  Python

centos7.5 nginx 报这错。也没找到什么原因?

  •  
  •   python30 · 2020-03-26 00:36:00 +08:00 · 2519 次点击
    这是一个创建于 1706 天前的主题,其中的信息可能已经有所发展或是发生改变。

    上面的 ssl 这个警告找到原因了 云掉了 nginx 里的 ssl on; 下面的 alert open socket left in connection 6 之类的错误 是什么原因? 查了半天搜索也没结果

    django2.2 重设密码的时候 总是卡住超时 提示:

    504 Gateway Time-out nginx/1.16.1

    看了一下错误日志: 2020/03/26 00:26:10 [error] 1073#0: *20 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 123.19.12.1, server: www.xxxxx.com, request: "POST /user/password/reset/ HTTP/1.1", upstream: "uwsgi://127.0.0.1:8001", host: "www.xxxx.com", referrer: "https://www.xxxx.com/user/password/reset/"

    就是在运行 django2.2 重设密码的时候: https://www.xxxx.com/user/password/reset/

    出现超时卡住。

    以前好好的。前几天不知道改了什么就这样了 不知道跟上面图中的错误有关不?

    下面是相关配置:

    uwsgi.conf

    # myweb_uwsgi.ini file
    [uwsgi]
    
    #django-related settings
    socket = 127.0.0.1:8001
    # the base directory (full path)
    chdir = /var/www/website
    
    # Django s wsgi file
    module = website.wsgi:application
    
    env = DJANGO_SETTINGS_MODULE = website.settings
    daemonize = /var/log/nginx/website_access.log;
    # process-related settings
    # master
    master = true
    py-autoreload = 1
    
    # maximum number of worker processes
    processes = 4
    threads = 2
    # ... with appropriate permissions - may be needed
    # chmod-socket = 664
    # clear environment on exit
    vacuum = true
    

    nginx.conf

    user nginx;
    worker_processes 4;
    error_log /var/log/nginx/error.log;
    pid /run/nginx.pid;
    
    include /usr/share/nginx/modules/*.conf;
    worker_rlimit_nofile 65535;
    events {
    use epoll;
    worker_connections 20000;
    }
    
    http {
    log_format main '$remote_addr - $remote_user [$time_local] "$request" '
    '$status $body_bytes_sent "$http_referer" '
    '"$http_user_agent" "$http_x_forwarded_for"';
    
    access_log /var/log/nginx/access.log main;
    
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 60;
    client_header_buffer_size 4k;
    types_hash_max_size 2048;
    
    include /etc/nginx/mime.types;
    default_type application/octet-stream;
    
    include /etc/nginx/conf.d/*.conf;
    
    server {
    listen 443;
    server_name website.com;
    ssl on;
    ssl_certificate 1_www.website.com_bundle.crt;
    ssl_certificate_key 2_www.website.com.key;
    ssl_session_timeout 5m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
    ssl_prefer_server_ciphers on;
    charset UTF-8;
    access_log /var/log/nginx/website_access.log;
    error_log /var/log/nginx/website_error.log;
    
    client_max_body_size 75M;
    fastcgi_buffers 8 128k;
    fastcgi_busy_buffers_size 128k;
    
    
    location / {
    include uwsgi_params;
    uwsgi_pass 127.0.0.1:8001;
    uwsgi_send_timeout 300;
    uwsgi_connect_timeout 300;
    uwsgi_read_timeout 300;
    }
    location /static {
    expires 30d;
    autoindex on;
    #return 403;
    add_header Cache-Control private;
    alias /var/wwwr/website/static/;
    }
    location /media {
    expires 30d;
    autoindex on;
    #return 403;
    add_header Cache-Control private;
    alias /var/wwwr/website/media/;
    }
    }
    
    2 条回复    2020-03-26 14:06:03 +08:00
    just1
        1
    just1  
       2020-03-26 00:51:46 +08:00
    upstream timed out (110: Connection timed out) while reading response header from upstream
    这个是 django 超时了
    python30
        2
    python30  
    OP
       2020-03-26 14:06:03 +08:00
    @just1
    解决了
    忙到半夜一点
    原来是腾讯云服务器端口 25 封了
    解封后就没问题了

    有时候一点小事就卡半天。愁人啊
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5690 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 06:32 · PVG 14:32 · LAX 22:32 · JFK 01:32
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.