Answer the question
In order to leave comments, you need to log in
How to use variables from server_name nginx?
the essence of the problem there are several sites isa.site.com, isb.site.com ... isz.site.com
there are local folders /home/user/sites/a, /home/user/sites/b etc.. .in
nginx config
server {
listen 443;
server_name ~^is(?<subdomain_suffix>.+?)\.(site\.com.+)$;
set $root /home/user/sites/$subdomain_suffix;
root $root;
...
}
Answer the question
In order to leave comments, you need to log in
do not invent the wheel
1. you have 3 sites, make three configs as expected, do not reinvent the wheel, especially from scratch.
2. You have 300 sites, here a template engine or a web muzzle will help you, in fact, all this is also in bulk. and free of charge and of good quality, why twist the crutches, again, it is not clear.
3. You have dynamic domain names, but here it is reported to manage the core of the project and here it is strictly individual.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question