Nginx setup problem on 1st IP had multiple domain names?
Asked by paul juniper
How to configure nginx so that there are several sites on the 1st IP
Google has a lot of information on how to configure apache, and there is nothing on nginx, including on the official website.
I would be glad of any useful information, ideally, of course, would be a config.
Wait there are 2 IP on which on 1 site. The second IP was bought purely for the test. I’m trying to do everything on different IPs on 1st IP.
Part of the current config:
server {
listen 89.248.105.84:80;
server_name termoteks.ru www.termoteks.ru;
root /var/www/vhosts/termoteks.ru/public;
passenger_enabled on;
}
server {
listen 89.248.105.87:80;
server_name eugene-studio.ru www.eugene-studio.ru;
location / {
root /var/www/vhosts/eugene-studio.ru/public;
index index.html index.htm;
}
ZY as it is clear from the part of the config, everything is spinning on REE and passenger
ZYY.Y. completely forgot, I only have nginx and no apache
Answers
Actually, you can not write at all.
In addition, it is convenient to create a separate config for each virtual host, store them in / etc / nginx / sites-aviable, and symlink to the / etc / nginx / sites-enabled folder those that should be currently enabled. These folders in the same debain are enabled by default. - natalie rasell
It is better to write, I have two IP on the interface. on one, the Apache is listening, and on the second, ngnix. There are a few more IPs that hang on lo, there are various applications on each IP, and ngnix proxies requests to them. - jessica katz
Sounds interesting ...
And why is this needed, what 127.0.0.1 does not suit you with? - rebekah degener
server {
listen X.X.X.X: 80;
server_name cdn.XXXX.ru;
...
}
server {
listen X.X.X.X: 80;
server_name cdn.gdeposylka.ru l.gdeposylka.ru;
...
}
in the listen directive, the IP should be the same in both servers