L
L
legolas44442015-04-09 16:16:52
Nginx
legolas4444, 2015-04-09 16:16:52

Dynamic subdomains on Nginx?

Good afternoon!
Given: VPS server (digitalocean);
Ubuntu 14.04
Nginx server
domain.com
Laravel 5
Task: Create custom subdomains like user.domain.com .... user34.domain.com etc. That is, a folder or entry in the hosts file should not be created for a specific subdomain. It is necessary that the user registers -> he is redirected to pupkin.domain.com, the server perceives it as domain.com, and Laravel itself will sort it out through Routes, for example:

Route::group(['domain' => '{account}.myapp.com'], function()
{

    Route::get('user/{id}', function($account, $id)
    {
        //
    });

});

and then he will give the necessary information. I just started to delve into all these DNS and VPS, etc. I've been worried for 3 days and can't find a solution in any way (((

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
IceJOKER, 2015-04-09
@legolas4444

Have you tried searching?
dffb88b549.jpg380a62bb0e.jpg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question