Alias of domain causes 404 error on Laravel

Operating system:
OS version:
Centos 7, Laravel 8, nginx

I created an “alias of domain” thru - create virtual server - in virtualmin.

Got the dns all setup, connected using cname or a record pointing to main site’s ip.

Alias domain itself appears connected to the main site
because I can access files on the main site thru alias domain. (phpinfo.php js files, etc…)

My app is using Laravel 8 and it’s the homepage that always returns a 404 not found error when accessed thru alias domain.

I don’t think it’s a php issue because phpinfo page shows up.
it could be laravel or virtualmin’s alias domain setting which is probably out of my scope to tackle this problem any further.

I’m asking for any help who’s familiar working with alias domain settings in virtualmin.

btw my app returns a 404 error on mainsite . com / index.php because I guess that’s how laravel app is designed. mainsite . com without the index.php shows the homepage.

Could it be that virtualmin’s alias domain is automatically setting things up in a way that alias domain’s root must be defaulted to index.php explicitly?

Is there a way to set it up properly in nginx conf?

Any help would be appreciated.