More subdomain mapping (dynamic 'root'?)

miradev nginx-forum at nginx.us
Fri Jul 3 14:42:14 MSD 2009


Frank Louwers Wrote:
-------------------------------------------------------
> 
> This is what we do for a customer: this allows
> them to create new  
> domains/projects just by making a new directory.
> With passenger and  
> php-fpm and this setup, he doesn't need to
> restart/reload *anything*  
> to start a new website.
>
> 
> server {
>          listen       80;
>          server_name  _;
>          server_name_in_redirect off;
>          passenger_enabled on;
>          passenger_use_global_queue on;
>          root  
> /home/customer/sites/$host/public;
> 
>          if (!-d $document_root) {
>                  #site not (yet) configureerd.
> Serve default
>                  rewrite (.*)
> http://default.customer.tld/;
>          }
> 
>          location / {
>            passenger_enabled on;
>                  index index.html index.htm
> index.php;
>          }
>          location ~ .php$ {
>                  fastcgi_pass 127.0.0.1:9000;
>                  fastcgi_index index.php;
>                  include fastcgi_params;
>          }
> }
> 

You are building one config file per client - you have '/home/customer/sites/' hard coded? I'm confused, sorry.

With my example (http://cnn.admin.domain.com/www.cnnminiblog.com) I would end up in
/home/customer/sites/cnn.admin.domain.com/public/www.cnnminiblog.com

I'd like the public folder inside the domain, so like this:
/home/cnn/sites/www.cnnminiblog.com/public

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,3586,3720#msg-3720






More information about the nginx mailing list