I have two web server one is Ruby and other is simple WordPress site. Now i want to redirect a page of ruby site to a wordpress page with out changing URL. so what i want is if ruby site is abc.com and wordpress site is xyz.com so if i type abc.com than redirect to xyz.com but it should be abc.com in url.

Ruby is served by nginx. i am able to redirect to wordpress site but URL is also changed.

  • 1
    The command you need is proxy_pass - read up on it. nginx.org/en/docs/http/ngx_http_proxy_module.html – Tim Nov 24 '16 at 7:31
  • 1
    Thanks, i am able to do this with the help of proxy pass and upstream. – amit singh Nov 24 '16 at 8:11
  • Once you get it working, please let other people with the same problem know the solution by posting and accepting it as your answer. – Daniel Nov 24 '16 at 9:27
up vote 1 down vote accepted

Finally i was able to do this, there is very simple solution for this.

http {
    upstream myproject {
        server abc.com;
    }

    include mime.types;

    server {
        listen 80;
        server_name xyz.com;
        location /about-us {
            proxy_pass http://myproject;
        }
     }
}

Hope it helps others

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.