3

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.

3
  • 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, 2016 at 7:31
  • 1
    Thanks, i am able to do this with the help of proxy pass and upstream.
    – amit singh
    Nov 24, 2016 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, 2016 at 9:27

1 Answer 1

3

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .