I have a php application(Yii framework) that lives on Heroku. I am trying to get the nginx configuration set up properly so that the app serves correctly. Right now, it serves the PHP but not that static files. Below is my nginx configuration along with the command inside the Procfile. Any help is appreciated.
--Procfile--
web: vendor/bin/heroku-php-nginx -C nginx.conf
--nginx.conf--
location / {
try_files $uri @rewriteapp;
}
location @rewriteapp {
rewrite ^(.*)$ /myapp/public/index.php/$1 last;
}
location /css {
alias /myapp/public/css/;
}
location /js {
alias /myapp/public/js/;
}
location /img {
alias /myapp/public/img/;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass heroku-fcgi;
}
example.com/assets/js/jquery.min.js...try_filesdirective in nginx (link)