Skip to content

Instantly share code, notes, and snippets.

@jasonmccallister
Created December 14, 2015 05:11
Show Gist options
  • Save jasonmccallister/2d0dbf9db0f396470545 to your computer and use it in GitHub Desktop.
Save jasonmccallister/2d0dbf9db0f396470545 to your computer and use it in GitHub Desktop.
Craft Heroku Nginx Config
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;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment