<p>I solved the problem by setting the client_max_body_size to, in my case, 20M.</p>

<p>Did this using the following nginx_app.conf</p>

<pre><code>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 off;
}
</code></pre>

CC BY-SA 3.0
2014-11-25T11:57:27.490Z
2014-11-25T11:57:27.490Z
Bjorn van Spengen
<p>Has anyone had success hosting Craft on Heroku? I got it up and running, but can't get file uploads to work. Also image thumbnails don't get generated. I am using Craft PRO and Assets are hosted on Amazon S3. I understand that you can't upload assets to Heroku, I thought using S3 should be sufficient to circumvent that fact.</p>

CC BY-SA 3.0
2014-11-26T11:02:28.527Z
I'm having trouble getting it up and running at all -- can you offer any suggestions or give any kind of walkthrough?
adrienne
CC BY-SA 3.0
2014-11-26T12:18:45.577Z
@adrienne, please ask a detailed question of your own.
Florian
CC BY-SA 3.0
2014-11-27T16:29:00.613Z
Florian: it's not worth it to me; I'll just give up on Heroku if there's not a walkthrough available somewhere.
adrienne
CC BY-SA 3.0
2014-11-30T18:11:14.543Z
@adrienne lookie here :D https://medium.com/@aj1215/craft-cms-on-heroku-79b991665b0b
Florian
<assets><server><upload>
Hosting Craft on Heroku, problems with Asset uploads and thumbnail generation
# Hosting Craft on Heroku, problems with Asset uploads and thumbnail generation

(Asked by: username_0 on 2014-11-06)

Has anyone had success hosting Craft on Heroku? I got it up and running, but can't get file uploads to work. Also image thumbnails don't get generated. I am using Craft PRO and Assets are hosted on Amazon S3. I understand that you can't upload assets to Heroku, I thought using S3 should be sufficient to circumvent that fact.

**Tags:** assets, server, upload

> **Comments:**
> **username_1**: I'm having trouble getting it up and running at all -- can you offer any suggestions or give any kind of walkthrough?  
> **username_0**: @username_1, please ask a detailed question of your own.  
> **username_1**: username_0: it's not worth it to me; I'll just give up on Heroku if there's not a walkthrough available somewhere.  
> **username_0**: @username_1 lookie here :D https://medium.com/@aj1215/craft-cms-on-heroku-79b991665b0b  

---

## 1 answers

### Answer by username_2 on 2014-11-25. Score: 4 | Accepted answer

I solved the problem by setting the client_max_body_size to, in my case, 20M.
Did this using the following nginx_app.conf
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 off;
}


---

