【问题标题】:Where did Pylons beautiful error handling go? Using Nginx + Paster + Flup#fcgi_threadPylons 漂亮的错误处理哪里去了?使用 Nginx + Paster + Flup#fcgi_thread
【发布时间】:2011-02-02 17:23:44
【问题描述】:

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

我一直在使用 lighttpd + paster + Flup#scgi_thread 并且 Pylons 的漂亮错误报告在那个环境中运行良好。

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

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

http://drp.ly/Iygeg

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

【问题讨论】:

    标签: python error-handling nginx pylons paster


    【解决方案1】:

    我猜你需要配置 Flup 来禁用它自己的错误处理,这样 Paster 使用的 nice 就可以通过了。

    【讨论】:

      【解决方案2】:

      您似乎没有从 _debug/media/traceback.css 获取引用 css 您可能想看看您是否可以查看实际的 CSS 并调查 nginx 是否应该直接为您的静态内容提供服务。

      【讨论】:

      • 这不是 CSS 的问题;该屏幕截图显示了由 Python 标准库的 cgitb 模块生成的错误页面,而不是由 WebError 生成的页面。
      猜你喜欢
      • 2012-11-05
      • 2019-07-16
      • 1970-01-01
      • 1970-01-01
      • 2017-12-01
      • 2011-04-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多