D
D
Damascus2015-12-20 15:47:12
Nginx
Damascus, 2015-12-20 15:47:12

Create correct config for subdomain in nginx?

Good afternoon!
There is a task to create 1200 subdomains. Tell me how to make the nginx config correctly?
All domains are tied to the same folder on the server.
DNS bound to pdd.ysndex.ru

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Burov, 2015-12-20
@BuriK666

just make default_server not to list all 1200 domains.

N
nirvimel, 2015-12-20
@nirvimel

http {
  server {
    server_name *.mydomain.com;
    location / {
      root /path_to/www-data;
      index index.html;
    }
  }
}

All 100500 *.mydomain.com subdomains will be mapped to the same /path_to/www-data directory.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question