Pylons 漂亮的错误处理哪里去了?使用 Nginx +贴纸 + Flup#fcgi_thread
我需要通过 nginx 运行我的开发,因为我的 pylons 应用程序中有一些复杂的子域路由规则,否则无法处理。
我一直在使用lighttpd + Paster + Flup#scgi_thread,并且 Pylons 的错误报告在该环境中运行良好。
昨天我重新编译了 64 位的 Python 和 MySQL,并且还切换到了 Ngix + Paster + Flup#fcgi_thread 作为我的开发环境。
一切都很好,但我怀念那些花哨的错误报告。这就是我现在得到的,与我习惯的相比,这是一团糟:
有效的 XHTML http://drp.ly/Iygeg。
这是 pylons/nginx 配置。
塔架:
[server:main]
use = egg:Flup#fcgi_thread
host = 0.0.0.0
port = 6500
Nginx:
location / {
#include /usr/local/nginx/conf/fastcgi.conf;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_pass_header Authorization;
fastcgi_intercept_errors off;
fastcgi_pass 127.0.0.1:6500;
}
I need to run my development through nginx due to some complicated subdomain routing rules in my pylons app that wouldn't be handled otherwise.
I had been using lighttpd + paster + Flup#scgi_thread and the nice error reporting by Pylons had been working fine in that environment.
Yesterday I recompiled Python and MySQL for 64bit, and also switched to Ngix + paster + Flup#fcgi_thread for my development environment.
Everything is working great, but I miss the fancy error reports. This is what I get now, and it is a mess compared to what I got used to:
Valid XHTML http://drp.ly/Iygeg.
And here are the pylons/nginx configs.
Pylons:
[server:main]
use = egg:Flup#fcgi_thread
host = 0.0.0.0
port = 6500
Nginx:
location / {
#include /usr/local/nginx/conf/fastcgi.conf;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_pass_header Authorization;
fastcgi_intercept_errors off;
fastcgi_pass 127.0.0.1:6500;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我猜你需要配置 Flup 来禁用它自己的错误处理,以便 Paster 使用的好错误可以通过。
I would guess that you need to configure Flup to disable its own error handling, so that the nice one one used by Paster could pass through.
看起来您没有从 _debug/media/traceback.css 获取引用 css 您可能想看看是否可以查看实际的 CSS 并调查 nginx 是否应该直接为您的静态内容提供服务。
It looks like you are not getting the trackback css from _debug/media/traceback.css You might want to see if you can view the actual CSS and investigate whether nginx should serve your static content directly.