502 错误网关 - Cherokee 上的 django/cherrypy HTTP 反向代理循环

发布于 2024-12-05 14:20:01 字数 1815 浏览 1 评论 0原文

所以我安装了 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:-

enter image description here

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我的奇迹 2024-12-12 14:20:01

问题解决了。指定内部IP,一切都很好!

Problem solved. Specify the internal IP and all is good!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文