I have been trying serve multiple directories in one location so that all files can be access on /sys/assets/--FILE-- regardless of where is the file physically locate in the following folder
location /sys {
alias /var/www/website_api/sys/public;
try_files $uri $uri/ /sys/index.php$is_args$args;
location ~ \.php {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(.*)$;
include /etc/nginx/fastcgi_params;
}
location /sys/assets {
alias /var/www/website_api/sys/app/assets/javascripts/;
}
location /sys/assets {
alias /var/www/website_api/sys/app/assets/stylesheets/;
}
location /sys/assets {
alias /var/www/website_api/sys/app/assets/images/;
}
}
Goal:
/sys/assets/javascriptFile.js
/sys/assets/stylesheetFile.css
/sys/assets/image.png