V
V
vekozlov2016-09-25 22:33:18
Nginx
vekozlov, 2016-09-25 22:33:18

How to set up subdomain redirection to another server?

I need help in solving the following problem: I
have a client's domain: www.clientwebsite.ru I
have my website: www.mywebsite.ru
I need the client's subdomain to reflect a specific page of my site.
subdomain.clientwebsite.ru -> www.mywebsite.ru (digitalocean, nginx, unicorn, ruby ​​on rails)
What should be written where?
Thanks in advance
upd 1:
I'll explain - I need the address of the client subdomain and the site to be displayed in a line, and the page itself displays the content of my site.
upd 2:
The solution that came up was a proxy from the nginx side of the client site.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
vsuhachev, 2016-09-26
@vekozlov

there are the following options:

  1. register in DNS for subdomain.clientwebsite.ru the ip-address of your server
  2. set up a proxy from clientwebsite.ru to your server

R
romy4, 2016-09-25
@romy4

Are these two different sites? If not, then subdomain.clientwebsite.ru must be specified in the server_name directive. Then it’s up to the framework to parse the request from which domain it came from.

A
Andrey Demidenko, 2016-09-25
@Dem1

For example in nginx

server {
  server_name  subdomain.clientwebsite.ru;
  location / {
    return 302 www.mywebsite.ru
  }
}

K
Kovalsky, 2016-09-26
@lazalu68

Couldn't the solution be to host a stub server on a subdomain that would simply display the desired pages of your site in an iframe ?
If I understood everything correctly, then such a solution is at least workable.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question