diff --git a/Procfile b/Procfile index 5e4d8ce..361b006 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: vendor/bin/heroku-php-nginx -C ./setup/nginx.conf +web: vendor/bin/heroku-php-nginx -C setup/nginx_heroku.conf diff --git a/setup/nginx_heroku.conf b/setup/nginx_heroku.conf new file mode 100644 index 0000000..0088eff --- /dev/null +++ b/setup/nginx_heroku.conf @@ -0,0 +1,15 @@ +location / { + # try to serve file directly, fallback to rewrite + try_files $uri @rewriteapp; +} + +location @rewriteapp { + # rewrite all to index.php + rewrite ^(.*)$ /index.php/$1 last; +} + +location ~ ^/index\.php(/|$) { + try_files @heroku-fcgi @heroku-fcgi; + # ensure that /index.php isn't accessible directly, but only through a rewrite + internal; +}