Try this - Place in your server block for myapp.com, anywhere outside another location block. Set the root to the same root as the dashboard
subdomain (if on the same server). The script would see itself as being hosed at myapp.com
instead of dashboard.myapp.com
, but it should retain the remainder of the framework rules. If this doesn't work, try the next option.
location /download/file-slug {
root /path/folder;
try_files $uri $uri/ /index.php?q=$uri&$args;
}
Another option is to proxy through Nginx. This option actually runs the script on the current location, accessing it like a client would through dashboard.myapp.com
. See proxy_pass documentation on Nginx.org.
location /download/file-slug { proxy_pass http://dashboard.myapp.com/download/file-slug; }