D
D
Dnebl2015-12-04 12:53:33
Nginx
Dnebl, 2015-12-04 12:53:33

How to make Nginx redirect requests to apache virtual hosts?

Hello! There are two virtual machines. On one is apache with configured virtual hosts for site.ru and test.site.ru (2 sites per 1 ip)
On the other is nginx.
Is it possible to configure nginx so that when accessed by domain name, nginx will proxy the request to the desired Apache virtual host?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
vdvpie22, 2015-12-04
@vdvpie22

Perhaps
look towards upsteam and proxy_pass in nginx

Y
Yuri, 2015-12-04
@xtreme

Can.
By default, if proxy_set_header is not used anywhere, then everything will work like that. If you need to explicitly set names in the backend that are not the same as in the frontend - in this case, we prescribe the header substitution
Next, Apache, if NameVirtualHost is configured on it, when a request from nginx hits it, it will send a request to the virthost with the name passed in the Host header.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question