Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7671177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:59:24+00:00 2026-05-31T15:59:24+00:00

I am totally new to nginx deployment and having problem setting up the subdomain

  • 0

I am totally new to nginx deployment and having problem setting up the subdomain for rails app which is running in passenger. My app structure is like this

    -- sss.com (parent domain)
        -- sub.sss.com (subdomain)
    -- zzz.com (which will be redirected to sub.sss.com)

For more clear perspective, think of the gmail structure

    -- google.com (parent domain)
          - mail.google.com (subdomain)
    -- gmail.com  (which will be redirected to mail.google.com)

And remember sub.sss.com is not just a directory under sss, its completely a different rails app.

To setup a similar structure i have configured nginx like this

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

    server {
        listen   80;

        server_name   sss.com;

        passenger_enabled   on;

        access_log   logs/sss.log;
        error_log    logs/sss_error.log; 

        root  /var/www/sss/public;        
    }    
    server {
        listen   80;

        server_name   sub.sss.com;

        passenger_enabled   on;

        access_log   logs/sub.log;
        error_log    logs/sub_error.log;

        root   /var/www/sub/public;        
    } 
    server {
        listen   80;
        server_name   zzz.com;
        rewrite ^(.*) http://sub.sss.com$1 permanent;      
    }      

When i start nginx i got this warning message

nginx: [warn] conflicting server name "sss.com" on 0.0.0.0:80, ignored

And got this message when tried to access the url http://www.sss.com

Chrome – Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.

FF – Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

But when i access zzz.com, it successfully redirects to sub.sss.com with a same error.

Seems its messed up in some kind of loop. anybody got a idea how to solve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T15:59:25+00:00Added an answer on May 31, 2026 at 3:59 pm

    In your first server you define the sss.com like server in the second too. You just need delete from first. like that :

    server {
         listen   80;
         server_name  *.sss.com;
         rewrite ^(.*) http://sss.com$1 permanent;
    }   
    
    server {
        listen   80;
    
        server_name   sss.com;
    
        passenger_enabled   on;
    
        access_log   logs/sss.log;
        error_log    logs/sss_error.log; 
    
        root  /var/www/sss/public;        
    }    
    server {
        listen   80;
    
        server_name   sub.sss.com;
    
        passenger_enabled   on;
    
        access_log   logs/sub.log;
        error_log    logs/sub_error.log;
    
        root   /var/www/sub/public;        
    } 
    server {
        listen   80;
        server_name   zzz.com;
        rewrite ^(.*) http://sub.sss.com$1 permanent;      
    }      
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im totally new to rails. here my question: i made an app with articles
I am absolutely and totally new to rails, so the answer is probably very
I'm totally new to C# and I'm having an error that I can't guess
Being totally new into node.js environment and philosophy i would like answers to few
I'm totally new to flash, and I'm trying to build a very simple app.
I'm totally new to Mac OS and iPhone and I'm writing some small app.
I'm totally new to XCode 3 (running Snow Leopard) and have no idea what
I am totally new to URL Rewriting and WildCard Subdomain management. My requirement is
Hi i'm totally new to EF and i'm having difficulties getting my head around
I am totally new to emacs and is starting to learn how to use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.