Created
April 17, 2015 12:08
-
-
Save martijngastkemper/c28681ce53df19a5b7ff to your computer and use it in GitHub Desktop.
Use this Nginx configuration to properly run Symfony in production (online) and development (local) environments on Heroku.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location / { | |
# try to serve file directly, fallback to rewrite | |
try_files $uri @rewriteapp; | |
} | |
location @rewriteapp { | |
# rewrite all to app.php | |
rewrite ^(.*)$ /app<?php echo getenv('SYMFONY_ENV') === 'prod' ? '' : '_dev'; ?>.php/$1 last; | |
} | |
location ~ ^/(app|app_dev|config)\.php(/|$) { | |
try_files @heroku-fcgi @heroku-fcgi; | |
internal; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment