Proxy/Redirect issue

Phil Bayfield phil at
Wed Nov 17 19:11:08 MSK 2010

I have setup an nginx proxy with a couple of servers behind it, also running

For the most part everything works nicely, although I have a strange issue.

I have my domains setup with a wildcard CNAME record so any subdomain should

I have a couple of vhosts setup intitially and which
work fine.

I have tried to redirect any requests from sub domains of these 2 domains as

server {
        listen 80;
        server_name *;
        rewrite ^/(.*)$$1 permanent;

I also tried using a check against the hostname.

The problem is the redirect works for, but not for,
any request to is redirected to

Can anyone help resolve this?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list