Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two domain's set up on my server. Domain 1 is configured with google apps so that goes to google's mail. However, I would like to redirect to

Currently in my nginx.conf file

I had

server {
    listen 80;
    rewrite ^/(.*) permanent;
    root /home/demo/apps/cjl/public;
    passenger_enabled on;
    rails_spawn_method smart;

When I did this Firefox popped up a "Redirect not configured correctly" error and said that it thought that the redirect would create a never ending loop.

I'm wondering how to set this up and any help would be appreciated. Thank you!

share|improve this question
up vote 0 down vote accepted

make another server {} for

The loop is happening due to the redirect being happening on both server_name's

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.