Proxy subdomain root to a different server url

Vahan Yerkanian vahan at helix.am
Sat May 12 12:03:57 UTC 2012


Hi Chris,

I was missing $1 in the end of the uri so the rewrite works.
Without it, it was being silently ignored and was creating a redirect loop.

For the mailing list archival purposes, here is what I ended up with:

        server {
                listen          11.22.33.44:80;
                server_name     abcd.domain.com;

                location / {
                        rewrite ^(.*)$ /path1/path2/filename$1 break;
                        proxy_pass http://www.domain.com;
                }
                server_tokens   off;
        }


Thanks again,
Vahan


On May 12, 2012, at 2:44 PM, christian.boenning at gmail.com wrote:

> Hi,
> 
> I think what you might need to set is 'proxy_redirect'. I'm running a similar setup which works this way. 
> 
> Regards,
> Chris
> 
> 
> Sent from BlackBerry® Device
> 
> -----Original Message-----
> From: Vahan Yerkanian <vahan at helix.am>
> Sender: nginx-bounces at nginx.orgDate: Sat, 12 May 2012 14:37:32 
> To: <nginx at nginx.org>
> Reply-To: nginx at nginx.org
> Subject: Proxy subdomain root to a different server url
> 
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx



More information about the nginx mailing list