2016-01-31 24 views
1

我熟悉heroku,但是對於Craft cms來說是新的。爲了獲得一個網站運行,我遵循本教程:https://medium.com/@aj1215/craft-cms-on-heroku-79b991665b0b#.8b561b1b4無法獲取在Heroku上運行的Craft cms/server

但該網站無法正常運作。我的heroku應用程序只是導致:「應用程序錯誤應用程序中發生錯誤,您的頁面無法投放。請稍後重試。如果您是應用程序所有者,請查看日誌以瞭解詳細信息。「

我的開發服務器運行良好。但我不知道我需要做些什麼來讓heroku應用程序運行。我正在拉我的頭髮。

我試過了所有我能想到的東西,但無法讓它工作。我不確定我做錯了什麼。

這些是朝向我的Heroku日誌的結束消息:

2016-01-31T03:09:21.480751 + 00:00應用程式[web.1]:nginx的:[EMERG]「服務器」 指令不允許在/app/nginx_app.conf: 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 path =「/」host = paradata2.herokuapp.com request_id = 1e502143-94ac-4aea-b34b-3087addd1d20 fwd =「172.11.56.78」 dyno = connect =服務=狀態= 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; 
     } 
    } 
} 
+0

消息必須格式化爲引用不作爲源代碼,這改進了識別它們的方式,並將上下文的其他源代碼分開 –

回答

1

我已經解決了這個問題。

我需要在enginx_app.conf文件中刪除對'server'和'http'的調用。現在該文件只打電話給'位置'。