Answer the question
In order to leave comments, you need to log in
How to set up Nginx redirects in Heroku?
The root of the project contains index.php and nginx_app.conf.
Content of nginx_app.conf:
location / {
try_files $uri $uri/ =404;
rewrite ^(.+)$ /index.php?key=$1;
}
vendor/bin/heroku-php-nginx -C nginx_app.conf
Using Nginx server-level configuration include 'nginx_app.conf'
Optimizing defaults for 1X dyno...
4 processes at 128MB memory limit.
Starting php-fpm...
Starting nginx...
Answer the question
In order to leave comments, you need to log in
location ~/(.*)$ {
try_files $uri $uri/ /index.php?key=$1;
}
location / {
try_files $uri $uri/ /index.php?key=$uri;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question