Answer the question
In order to leave comments, you need to log in
Is it possible to set up multiple subdomains per directory but different index files?
Hello.
Is it possible to configure apache2+nginx so that different subdomains point to the same directory but have different index files?
For example:
sub1.site.loc >> /var/www/site.loc/sub/index1.php
sub2.site.loc >> /var/www/site.loc/sub/index2.php
sub3.site.loc > > /var/www/site.loc/sub/index3.php
sub4.site.loc >> /var/www/site.loc/sub/index4.php
Answer the question
In order to leave comments, you need to log in
Can. If your PHP handles nginx you can use map. Here is an excerpt from the config:
map $http_host $index_file {
nginx-test.loc index.php;
one.nginx-test.loc index1.php;
two.nginx-test.loc index2.php;
}
server {
listen 80;
server_name nginx-test.loc *.nginx-test.loc;
root /var/www/nginx-test;
index $index_file;
# остальные параметры
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question