I have built a base laravel site with authorization using nginx as the web server.
Then I have created another laravel instance under the main directory in the original site and added a simple index.html page for testing.
I created a server block in sites-available for the default site and another for he subdomain.
I created a symlink in sites-enabled and when I run 'curl sub.domain.com it resolves the index.html page on the second laravel instance.
When I try this from the browser it does not resolve.
I made an entry in the hosts file '127.0.0.1 domain.com sub.domain.com'
I also tried 'DNS IP Address sub.domain.com'
In the routes file I tried the suggested code from Laravel
Route::group(['domain' => '{sub}.domain.com'], function () {
Route::get('/', function ($sub) {
return $sub;
});
});
To make the site more manageable I wanted to utilize the sites-avialable/sites-enbaled functionality of Nginx. Being able to take a subdomain offline for updates and not affecting the core site and other subs.