backend rewrite of subdomains

Eden Li eden at mojiti.com
Thu Dec 20 06:39:50 MSK 2007


probably something like:

server {
 # no server_name statement

 set $subdomain "default";
 if ($http_host ~ "^(.+?)\.") {
   set  $subdomain  $1;
 }

 proxy_pass http://staging.example.com/${subdomain}$request_uri;
}

You might need to add a slash here between subdomain and request_uri.

On 12/19/07, Wayne E. Seguin <wayneeseguin at gmail.com> wrote:
> On Dec 19, 2007 4:32 PM, Eden Li <eden at mojiti.com> wrote:
>
> > You need to use proxy_pass to have nginx funnel the content from
> > staging.example.com in order for it to appear to be coming from
> > subdomain.staging.example.com.
> >
> > proxy_pass variable support was added in 0.6.18
> >
> >
> >
>
> I'm willing to add 0.6.X to gain this feature.
> What would it look like then?
>





More information about the nginx mailing list