H
H
hps2011-11-10 22:43:40
Nginx
hps, 2011-11-10 22:43:40

Nginx+apache and virtual hosts?

Colleagues, who can explain in a nutshell: if nginx works in conjunction with apache, is it worth creating virtual hosts in nginx or is it better to leave their processing to apache (and why).

Answer the question

In order to leave comments, you need to log in

4 answer(s)
E
Evengard, 2011-11-10
@Evengard

Isn't it necessary to create both there and there? Or do you have different domains static files use the same? Or vice versa - static files are different, but scripts are all the same?

M
max_rip, 2011-11-11
@max_rip

If you have nginx just as a proxy, then you don't need it. But this makes little sense. It is better to set it on static, then you need to create hosts here and there. Although it all depends on the implementation of the hosts themselves. Everything can be beautifully configured so that nginx does not pull.
Like /var/www/domen.com/, and take domen.com as a variable from the current host, but then all sorts of www.domen.com , etc. disappear.

A
admin4eg, 2011-11-11
@admin4eg

and Thai and there virtual hosts are created.
describe in more detail the question, what do you have and what do you want to receive

H
hps, 2011-11-11
@hps

If I did not create virtual hosts in nginx, then different domains still work (Apache shows them). Static files of all domains can be described through location within one server in nginx (as far as I understand), let's say there are site1.com/uploads and site2.ru/img. I'm just describing location /uploads and location /img within the same server
. The main reason for using nginx, I see saving RAM.
Actually questions:
1. Than such scheme is bad?
2. Will it work at all? That is, will nginx process statics in this case, or will Apache actually give it away, and I will be naively ignorant?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question