Perhaps change the baseURL in config/environment.js to '/url/app1/' for http://test.com/url/app1
if (environment === 'production') {
ENV.baseURL = '/url/app1/';
}
And do the same for app2.
If needed place a .htaccess in embers public folder like this