I'm having a heck of a time getting this (hopefully simple) solution implemented.
We have a site at site.com and served from /home/site/public. We need a specific SUBDIRECTORY of site.com (site.com/gps) to be served from a DIFFERENT document root to avoid security implications. IE site.com/gps should be served from /home/sitegps/public. I have implemented the following location block, but it just results in an http 500 due to infinite redirects. I'm hoping that someone has done this before and knows where I'm going wrong...
# Send all /gps requests to new root
location ~ ^/gps(?:/(.*))?$ {
alias /home/sitegps/public;
try_files $uri $uri/ /gps/index.php?$uri&$args;
}