Hi Members,
I have a working nginx server with ~50 virtual domains, 150+ virtual hosts. I would like to simplify my config file. Now every domain has a separate config file with virtual host configs. My clients upload their content via ftp, every client sees his whole domain.
I would like to serve that content from the following direcory structure:
/domain1.tld/www.domain1.tld -> www.domain1.tld
/domain1.tld/sub1.domain1.tld -> sub1.domain1.tld
/domain1.tld/subsub1.domain1.tld -> subsub1.sub1.domain1.tld
/domain2.tld/www.domain2.tld -> www.domain2.tld
/domain2.tld/sub2.domain2.tld -> sub1.domain2.tld
/domain2.tld/subsub2.domain1.tld -> subsub2.sub2.domain2.tld
etc.
How can I exctract the domain name (domain1.tld) from the request ($host -> eg. sub1.domain1.tld)?
My goal is, to exctact the domain, and subsitute it in the nginx.conf as a part of the directory stucture. (/$domain/$host/)
Thank you in anticipation.
In Dul