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
tmackan
V2EX  ›  Python

uwsgi+nginx 配置,然后浏览器报错 ERR_EMPTY_RESPONSE

  •  
  •   tmackan ·
    tmacjx · 2016-08-23 21:58:13 +08:00 · 11481 次点击
    这是一个创建于 3047 天前的主题,其中的信息可能已经有所发展或是发生改变。

    RT

    我的 nginx 配置 /etc/nginx/nginx.conf

    # For more information on configuration, see:
    #   * Official English Documentation: http://nginx.org/en/docs/
    #   * Official Russian Documentation: http://nginx.org/ru/docs/
    
    user nginx;
    worker_processes auto;
    error_log /var/log/nginx/error.log;
    pid /run/nginx.pid;
    
    events {
       worker_connections 1024;
    }
    
    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   65;
       types_hash_max_size 2048;
    
       include             /etc/nginx/mime.types;
       default_type        application/octet-stream;
    
       # Load modular configuration files from the /etc/nginx/conf.d directory.
       # See http://nginx.org/en/docs/ngx_core_module.html#include
       # for more information.
       include /etc/nginx/conf.d/*.conf;
    
    #    server {
    #        listen       80 default_server;
    #        listen       [::]:80 default_server;
    #        server_name  _;
    #        root         /usr/share/nginx/html;
    
    #        # Load configuration files for the default server block.
    #        include /etc/nginx/default.d/*.conf;
    
    #        location / {
    #        }
    
    #        error_page 404 /404.html;
    #            location = /40x.html {
    #        }
    
    #       error_page 500 502 503 504 /50x.html;
    #            location = /50x.html {
    #        }
    #    }
    }
    

    /etc/nginx/conf.d/blog.conf

    server {
       listen 80;
           server_name 服务器 ip 地址;
       # server_name xxx.com;
       access_log /var/log/LandsBlog/access.log;
       error_log /var/log/LandsBlog/error.log;
       location / {
       	#include uwsgi_params;
       	include /etc/nginx/uwsgi_params;
                   uwsgi_pass 127.0.0.1:8077;
       }
       #error_page 404 /404.html;
       # redirect server error pages to the static page /50x.html
       #
       error_page 500 502 503 504 /50x.html;
       location = /50x.html {
       	root html;
       }
       location /static/ {
       	alias /alidata/websites/LandsBLog/LandsBlog/Blog/static/;
       	index index.html index.htm;
       }
       location /media/ {
       	alias /alidata/websites/LandsBLog/LandsBlog/Blog/upload/;
       }
    }
    
    

    求解

    5 条回复    2017-09-05 16:26:57 +08:00
    tmackan
        1
    tmackan  
    OP
       2016-08-24 10:48:22 +08:00
    uwsgi.log 的日志:


    *** Starting uWSGI 2.0.13.1 (64bit) on [Wed Aug 24 10:42:59 2016] ***
    compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-4) on 19 August 2016 14:24:34
    os: Linux-3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015
    nodename: iZ230ph83b2Z
    machine: x86_64
    clock source: unix
    pcre jit disabled
    detected number of CPU cores: 1
    current working directory: /alidata/websites/LandsBLog
    detected binary path: /root/.virtualenvs/blog/bin/uwsgi
    uWSGI running as root, you can use --uid/--gid/--chroot options
    *** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
    chdir() to /alidata/websites/LandsBLog/LandsBlog
    your processes number limit is 7283
    your memory page size is 4096 bytes
    detected max file descriptor number: 65535
    lock engine: pthread robust mutexes
    thunder lock: disabled (you can enable it with --thunder-lock)
    uwsgi socket 0 bound to TCP address :8077 fd 3
    Python version: 3.4.1 (default, Aug 19 2016, 10:38:55) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)]
    Set PythonHome to /root/.virtualenvs/blog
    *** Python threads support is disabled. You can enable it with --enable-threads ***
    Python main interpreter initialized at 0x1b28a90
    your server socket listen backlog is limited to 100 connections
    your mercy for graceful operations on workers is 60 seconds
    mapped 507200 bytes (495 KB) for 4 cores
    *** Operational MODE: preforking ***
    WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x1b28a90 pid: 3998 (default app)
    *** uWSGI is running in multiple interpreter mode ***
    spawned uWSGI master process (pid: 3998)
    spawned uWSGI worker 1 (pid: 4000, cores: 1)
    spawned uWSGI worker 2 (pid: 4001, cores: 1)
    spawned uWSGI worker 3 (pid: 4002, cores: 1)
    spawned uWSGI worker 4 (pid: 4003, cores: 1)
    [pid: 4003|app: 0|req: 1/1] 140.205.145.230 () {30 vars in 392 bytes} [Wed Aug 24 10:43:50 2016] GET /check?ip=120.27.202.78_80 => generated 3823 bytes in 35 msecs (HTTP/1.1 404) 2 headers in 80 bytes (1 switches on core 0)


    显示已经接受到了请求,并且生成了 bytes 数据啊,但是浏览器还是访问不到。
    tmackan
        2
    tmackan  
    OP
       2016-08-26 11:36:51 +08:00
    uwsgi_proto_uwsgi_parser(): Inappropriate ioctl for device [proto/uwsgi.c line 40]

    目前报这个错误
    不支持的设备驱动?
    tmackan
        3
    tmackan  
    OP
       2016-08-26 14:08:53 +08:00
    有时候提示:
    uwsgi_proto_uwsgi_parser(): Resource temporarily unavailable [proto/uwsgi.c line 40]
    = =资源暂时不可用
    izoabr
        4
    izoabr  
       2016-08-26 15:17:33 +08:00
    用 proxy_pass 呢
    ox180
        5
    ox180  
       2017-09-05 16:26:57 +08:00
    @tmackan 关于

    ```
    uwsgi_proto_uwsgi_parser(): Resource temporarily unavailable [proto/uwsgi.c line 40]
    ```

    你是怎么解决的??
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5566 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 06:51 · PVG 14:51 · LAX 22:51 · JFK 01:51
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.