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 8688957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:30:50+00:00 2026-06-12T23:30:50+00:00

So I have two domains – www.mysite.com and sub.mysite.com sub.mysite.com is used by a

  • 0

So I have two domains – http://www.mysite.com and sub.mysite.com

sub.mysite.com is used by a number of legacy apps that can’t be updated for varying reasons, and their requests to URLs on that domain need to keep working. However, the code is being moved from the Rails application at sub.mysite.com, and will be integrated into http://www.mysite.com

The plan, at the moment, is to have the sub.mysite.com content available at http://www.mysite.com/sub, but I’m at a loss on how to get nginx to render content from http://www.mysite.com/sub as if it’s coming from sub.mysite.com

I’ve tried a couple of rewrite rules in the nginx config, but they keep redirecting me to http://www.mysite.com/sub URLs instead of sticking with the sub.mysite.com address.

At the bottom of my nginx config, I’ve currently got:

server{
  listen 80;
  server_name sub.mysite.com;
  location / {
    proxy_redirect off;
    proxy_pass http://www_server/sub;
  }
}

Is what I’m asking for even possible?

  • 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-06-12T23:30:51+00:00Added an answer on June 12, 2026 at 11:30 pm

    If I got it right what you want is this:

    location ^~ /sub/ {
        rewrite ^/sub/(.*) http://sub.example.com/$1 permanent;
    }
    

    Hope it helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a site that redirects from www.domain.com to www.domain.com/sub I have two domains
I have two different domains (let's say www.site1.com and www.site2.com) that point to the
I have two domains - abc.com and xyz.com. I have a CNAME that points
I have a website that is mirrored cross two sub-domains. So I have separate
This is the setup: I have two websites on two different domains: www.website1.com www.someotherwebsite.com
I have a domain domain.com and subdomain sub.domain.com Those two domains have different ftp
I have two domains - crmpicco.co.uk and ayrshireminis.com - if I browse to: www.crmpicco.co.uk/mini/new
i have to write htaccess for mysite. actually we have two domains. '.com and
We have two domains, www.aaa.com and www.bbb.com. Both point to the same root directory
I have two domains that are aliases, domain1.com and domain2.com Currently they are both

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.