Forum: NGINX Sub-domain filtering

2974d09ac2541e892966b762aad84943?d=identicon&s=25 ronin (Guest)
on 2013-08-19 08:05
(Received via mailing list)
I am using the statement is:
if ($ host! = www.mj.com|ci.mj.com) {rewrite ^ / (. *) $
http://www.mj.com/
$ 1 permanent;}
This page contains a redirect loop occurs causing the problem can not
access
the site, I ask you how to handle this statement to be compatible with
multiple subdomains, thank you

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,242007,242007#msg-242007
34011bc56457235a2caa5ed1d4a29f3c?d=identicon&s=25 Jonathan Matthews (Guest)
on 2013-08-19 09:14
(Received via mailing list)
On 19 Aug 2013 07:05, "ronin" <nginx-forum@nginx.us> wrote:
>
> I am using the statement is:
> if ($ host! = www.mj.com|ci.mj.com) {rewrite ^ / (. *) $
http://www.mj.com/
> $ 1 permanent;}
> This page contains a redirect loop occurs causing the problem can not
access
> the site, I ask you how to handle this statement to be compatible with
> multiple subdomains, thank you

Use a separate server{} for the redirection-only vhosts.

J
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.