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

2016-08-23 21:58:13 +08:00
 tmackan

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

求解

11444 次点击
所在节点    Python
5 条回复
tmackan
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
2016-08-26 11:36:51 +08:00
uwsgi_proto_uwsgi_parser(): Inappropriate ioctl for device [proto/uwsgi.c line 40]

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

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

你是怎么解决的??

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/301307

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX