Pylons 漂亮的错误处理哪里去了?使用 Nginx +贴纸 + Flup#fcgi_thread

发布于 2024-08-27 04:10:19 字数 1324 浏览 15 评论 0原文

我需要通过 nginx 运行我的开发,因为我的 pylons 应用程序中有一些复杂的子域路由规则,否则无法处理。

我一直在使用lighttpd + Paster + Flup#scgi_thread,并且 Pylons 的错误报告在该环境中运行良好。

昨天我重新编译了 64 位的 Python 和 MySQL,并且还切换到了 Ngix + Paster + Flup#fcgi_thread 作为我的开发环境。

一切都很好,但我怀念那些花哨的错误报告。这就是我现在得到的,与我习惯的相比,这是一团糟:

http://drp.ly/ Iygeg

有效的 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:

http://drp.ly/Iygeg

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

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

发布评论

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

评论(2

暗恋未遂 2024-09-03 04:10:19

我猜你需要配置 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.

痴意少年 2024-09-03 04:10:19

看起来您没有从 _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.

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