502 错误网关 - Cherokee 上的 django/cherrypy HTTP 反向代理循环
所以我安装了 cherokee 并将 django-cpserver 包含到我的 django 应用程序中。
此后,我运行
python manage.py runcpserver daemonize=1 port=3035 pidfile=/var/run/django/cherrypy.pid-1 threads=1 request_queue_size=0
并重复这些命令来生成 10 个进程cherrypy.pid-1、cherrypy.pid-2 等,cherrypy.pid-10。
在我的 cherokee 管理员上,我将这 10 个信息源映射到我的 django 实例:-
但是,重新启动后cherokee,它只是给了我一个 502 bad gateway 错误,查看我的 cherokee.error 日志,我看到一系列错误:-
{'type': "warning", 'time': "20/09/2011 06:39:26.264",
'title': "Taking source='localhost:3042' back on-line",
'code': "balancer_round_robin.c:170",
'error': "63", 'description': "The information source is being disabled.",
'version': "1.2.99", 'compilation_date': "Sep 16 2011 00:35:11",
'configure_args': " '--prefix=/usr' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-static' '--with-wwwroot=/srv/http' '--with-wwwuser=http' '--with-wwwgroup=http' '--with-python=python2' '--enable-os-string=Arch Linux' 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu' '--prefix=/usr' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-static' '--with-wwwroot=/srv/http' '--with-wwwuser=http' '--with-wwwgroup=http' '--with-python=python2' '--enable-os-string=Arch Linux' 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu'",
'backtrace': ""}
我不确定我的配置做错了什么。将不胜感激任何引导我走向解决此“502网关错误”问题的正确方向的指示。
(我应该补充一点,如果我在 cherokee 上使用 django 的标准 scgi 部署配置,一切都正常。但我想弄清楚如何使用 Cherrypy 作为反向代理在 cherokee 上部署 django。)
So I install cherokee and included django-cpserver into my django app.
Thereafter, I ran
python manage.py runcpserver daemonize=1 port=3035 pidfile=/var/run/django/cherrypy.pid-1 threads=1 request_queue_size=0
and repeated these commands to spawn 10 processes cherrypy.pid-1, cherrypy.pid-2, etc etc, cherrypy.pid-10.
On my cherokee admin, I then mapped these 10 information sources to my django instance:-
However, after restarting cherokee, it simply gives me a 502 bad gateway error and looking at my cherokee.error log, I see a series of errors that say:-
{'type': "warning", 'time': "20/09/2011 06:39:26.264",
'title': "Taking source='localhost:3042' back on-line",
'code': "balancer_round_robin.c:170",
'error': "63", 'description': "The information source is being disabled.",
'version': "1.2.99", 'compilation_date': "Sep 16 2011 00:35:11",
'configure_args': " '--prefix=/usr' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-static' '--with-wwwroot=/srv/http' '--with-wwwuser=http' '--with-wwwgroup=http' '--with-python=python2' '--enable-os-string=Arch Linux' 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu' '--prefix=/usr' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-static' '--with-wwwroot=/srv/http' '--with-wwwuser=http' '--with-wwwgroup=http' '--with-python=python2' '--enable-os-string=Arch Linux' 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu'",
'backtrace': ""}
I am not sure what I did wrong with my configuration. Will be grateful for any pointers leading me towards the right direction to resolve this "502 gateway error" issue.
(I should add that if I use the standard scgi deployment configuration for django on cherokee, everything works just fine. But I would like to figure out how to use cherrypy as a reverse proxy to deploy django on cherokee.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题解决了。指定内部IP,一切都很好!
Problem solved. Specify the internal IP and all is good!