Welcome! Log In Create A New Profile

Advanced

Proxy/Redirect issue

Phil Bayfield
November 17, 2010 11:14AM
I have setup an nginx proxy with a couple of servers behind it, also running
nginx.

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
work.

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

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

server {
listen 80;
server_name *.domain1.com;
rewrite ^/(.*)$ http://domain1.com/$1 permanent;
}

I also tried using a check against the hostname.

The problem is the redirect works for domain1.com, but not for domain2.com,
any request to something.domain2.com is redirected to domain1.com.

Can anyone help resolve this?

Thanks
Phil.
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Proxy/Redirect issue

Phil Bayfield November 17, 2010 11:14AM

Re: Proxy/Redirect issue

Phil Bayfield November 17, 2010 11:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 152
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready