J
J
john_chees72019-08-27 23:29:59
Nginx
john_chees7, 2019-08-27 23:29:59

Upstream backend for a specific domain?

Hello toaster!
I don't know much about system administration, so I decided to ask you..
There is an upstream backend:

upstream backend {
  server www.server1.ru;
  server www.server2.ru;
  server www.server3.ru; 
}
server {
location /{
   proxy_pass http://backend;

 }
}

But when you go to the site, a regular site opens, which is hosted on this server, and not a site on one of the backend servers. How can I make the user connect to one of the backend servers when going, for example, to app.site.ru?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vreitech, 2019-08-27
@fzfx

there is no directive server_namein the section server, while in the config there is another section serverlocated before yours, which processes the connections.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question