I'm familiar with Heroku, but new to Craft CMS. In order to get a site running, I followed this tutorial: https://medium.com/@aj1215/craft-cms-on-heroku-79b991665b0b#.8b561b1b4
But the site isn't functioning. My Heroku app just results in: Application Error An error occurred in the application and your page could not be served. Please try again in a few moments. If you are the application owner, check your logs for details.
My development server runs fine. But I have no idea what I need to do to get the heroku app to function. I'm pulling my hair out.
I've tried everything I can think of, but can't get it to work. I'm not sure what I'm doing wrong.
These are messages toward the end of my Heroku logs:
2016–01–31T03:09:21.480751+00:00 app[web.1]: nginx: [emerg] “server” directive is not allowed here in /app/nginx_app.conf:1
2016–01–31T03:09:21.475721+00:00 app[web.1]: Starting nginx…
2016–01–31T03:09:21.481090+00:00 app[web.1]: Process exited unexpectedly: nginx
2016–01–31T03:09:21.481236+00:00 app[web.1]: Going down, terminating child processes…
2016–01–31T03:09:22.183035+00:00 heroku[web.1]: Process exited with status 1
2016–01–31T03:09:22.182791+00:00 heroku[web.1]: State changed from starting to crashed
2016–01–31T03:09:27.185620+00:00 heroku[router]: at=error code=H10 desc=”App crashed” method=GET path=”/” host=paradata.herokuapp.com request_id=1e502143–94ac-4aea-b34b-3087addd1d20 fwd=”172.11.56.78" dyno= connect= service= status=503 bytes=
enginx_app.conf file:
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;
}
this is my craft/config/db.php
file:
<?php
$url = parse_url(getenv("CLEARDB_DATABASE_URL"));
return array(
'server' => $url["host"],
'user' => $url["user"],
'password' => $url["pass"],
'database' => substr($url["path"],1),
'tablePrefix' => 'craft',
);
server
block goes in thehttp
block and not the other way around: nginx.com/resources/wiki/start/topics/examples/full