I have a website running on Nginx, FastCGI and php-fpm, with a number of pages in subdirectories on it (that are run through the same front-controller as the rest of the website).
- http://www.example.com/ - main site
- http://www.example.com/sub/site/ - micro-site
I'm looking for a configuration that will allow one of the sub-sites to be served from an alternate URL, such as http://site.johndoe.com/ - the same site, with the same front-controller producing it (an index.php at a given location on disk), but only showing the content of http://www.example.com/sub/site/ as a new domain.
In summary, the url: http://site.johndoe.com needs to transparently show the contents of http://www.example.com/sub/site/ - what rewrites and other server{}
configurations are required with Nginx/FastCGI?
All you have to do is create a new virtual host for
site.johndoe.com
and point document root to the/sub/site
, something like this: