【问题标题】:Can't get Craft cms/server running on Heroku无法在 Heroku 上运行 Craft cms/server
【发布时间】:2016-02-03 03:02:22
【问题描述】:

我熟悉heroku,但对Craft cms 很陌生。为了让网站运行,我遵循了这个教程:https://medium.com/@aj1215/craft-cms-on-heroku-79b991665b0b#.8b561b1b4

但该网站无法正常运行。我的 Heroku 应用程序只是导致:“应用程序错误应用程序中发生错误,无法提供您的页面。请稍后重试。如果您是应用程序所有者,请查看您的日志以了解详细信息。”

我的开发服务器运行良好。但我不知道我需要做什么才能让 heroku 应用程序正常运行。我正在拔头发。

我已经尝试了我能想到的一切,但无法让它发挥作用。我不确定我做错了什么。

这些是我的 heroku 日志末尾的消息:

2016–01–31T03:09:21.480751+00:00 app[web.1]: nginx: [emerg] “服务器” /app/nginx_app.conf:1 中不允许使用指令 2016–01–31T03:09:21.475721+00:00 app[web.1]:启动 nginx… 2016–01–31T03:09:21.481090+00:00 app[web.1]:进程退出 意外:nginx 2016–01–31T03:09:21.481236+00:00 app[web.1]: 向下,终止子进程...... 2016–01–31T03:09:22.183035+00:00 heroku[web.1]:进程退出 状态 1 2016–01–31T03:09:22.182791+00:00 heroku[web.1]: 状态 从开始更改为崩溃 2016–01–31T03:09:27.185620+00:00 heroku[router]: at=error code=H10 desc=”App crashed” method=GET 路径=”/” 主机=paradata2.herokuapp.com request_id=1e502143–94ac-4aea-b34b-3087addd1d20 fwd=”172.11.56.78” dyno=连接=服务=状态=503字节=

nginx_app.conf 文件:

    server {
    http {
        location / {
            # try to serve file directly, fallback to rewrite
            try_files $uri @rewriteapp;
        }
        location @rewriteapp {
            # rewrite all to index.php
            rewrite ^(.*)$ /index.php?p=$1 last;
        }
        location ~ ^/(index)\.php(/|$) {
            client_max_body_size 20M;
            fastcgi_pass heroku-fcgi;
            fastcgi_split_path_info ^(.+\.php)(/.*)$;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param HTTPS on;
        }
    }
}

【问题讨论】:

  • 消息的格式必须是引用而不是源代码,这改进了识别它们的方式和分离上下文其余部分的源代码

标签: heroku server content-management-system


【解决方案1】:

我已经解决了这个问题。

我需要在我的 enginx_app.conf 文件中删除对“服务器”和“http”的调用。现在该文件只调用“位置”。

【讨论】:

    猜你喜欢
    • 2015-01-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-22
    • 2018-10-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多