0
0
0Boo2014-06-13 14:05:36
PHP
0Boo, 2014-06-13 14:05:36

How to implement dynamic subdomains on nginx?

There is a local server. Nginx + Apache2. Is it possible to create an unlimited number of subdomains like subdomain.localhost/. That is, without prescribing anything in hosts?
In the future, transfer subdomain.localhost/page_id to Apache with this path localhost?sub=$subdomain&id=page_id
PS subdomain can be anything, not previously known. Names are assigned by users.
This is done so that each user can create his own blog by assigning a name (subdomain)
to it and accessing a link like, for example, myblog.localhost/123.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
C
Cool Admin, 2014-06-14
@ifaustrue

Use Denver or LAMP if you want to test/develop. (Googling, the first link in the search results will tell you everything)
If you want to make _this_ work for users in production, then stop immediately. Raise the server, though with the same LAMP on Windows and let users go username.servername.domain or username.servername no localhost \ host files!

Y
Yakov Akulov, 2014-06-14
@jakulov

You can take a look at laravel.com/docs/queues
very easy to use, quite powerful, can be scaled

S
ShamblerR, 2015-04-06
@ShamblerR

Yes, you can, and without any problems, the only question is why.
If you constantly create them, then you use some kind of admin panel or a script
, go there and write down the generation of configs
;
why do you need a crutch

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question