backend rewrite of subdomains

Wayne E. Seguin wayneeseguin at gmail.com
Thu Dec 20 07:07:12 MSK 2007


On Dec 19, 2007 10:39 PM, Eden Li <eden at mojiti.com> wrote:

> 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<http://staging.example.com/$%7Bsubdomain%7D$request_uri>
> ;
> }
>
> You might need to add a slash here between subdomain and request_uri.
>
>
Eden I could kiss you right now ;)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20071219/6d08fe8d/attachment.html>


More information about the nginx mailing list