Answer the question
In order to leave comments, you need to log in
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)
{
//
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question