Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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.