Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

joerucci's avatar

Single forge "site", multiple domains.

In forge I know I can setup a single server to have multiple domains by creating multiple "sites" then doing something like this in the web routes.

Route::group(['domain' => 'example-1.com'], function() {
    Route::get('login', 'ExampleOneController@login');
});

Route::group(['domain' => 'example-2.com'], function() {
    Route::get('login', 'ExampleTwoController@login');
});

This works fine in the sense that "it works" but it means I need to create a new site in forge for each domain I want to use. As the number of sites grows so does the difficulty of maintaining the system and the overhead of having the same code repo replicated over and over again means I need a large drive size for really no reason.

Anyone have any ideas how I would maybe use a "default" site's Nginx file to accommodate all the different domains under a single site? Any help is appreciated, thanks!

0 likes
1 reply
joerucci's avatar
joerucci
OP
Best Answer
Level 2

For anyone who also had this question I found (not easily) the following.

https://blog.laravel.com/forge-alias-domains

You can add as many top level domains as you want to a single site. Although at the moment it does say "this is primarily intended for development sites".

Please or to participate in this conversation.