How to bind IP address to the domain?

Hello. I bought a dedicated IP address for your domain. There is a small VPS which revolves Nginx (proxy) + Apache. Now came the task to bind the IPS to the domain.
Whether correctly I understand sequence of actions:
1)In the DNS zone of the domain, deleted the A-record pointing to IP address of the VPS
2)In the DNS zone added the A-record that points to the purchased IP address
3)In your Nginx configuration registers listen;
4)Restart Bind, Nginx, Apache
(Apache is listening to
June 14th 19 at 21:04
3 answers
June 14th 19 at 21:06
Oh, and I have advised you domain to listen...

It must be so (relatively ip=

Or, without binding to ip address
It must be so (relatively ip=
listen 80;

Also, there may be several ports, such as for ssl.
listen 80;
listen 443 ssl;

A small remark. When you go to a domain name in a browser, your browser makes a DNS request to the NS server in the domain that asks the IP address of A record in the specified domain, then is drawn to this IP address on port 80 and requests the server to give it content if there is one in the configuration. If the domain is still configured - the web server returns the contents of the document_root or what you configured - if not, gives the client the contents of the first host configured in the chain configuration (usually configure without a domain, document_root put in empty index.html).

Ремарка2. And considering the fact that you have nginx running behind apache, you should not forget to tell nginx where to send content for this domain.
In your case, in "location /" should be something like that.
location / {
But if I have an alias of this site - for example, and I want him either to use a separate IP address, then I need to add some blocks server { with the same content but different server_name ?
Or this:

Have the A record and specify the IP address - Glennie_Beie commented on June 14th 19 at 21:09
So you have 2 different domain must refer to the same site on different IP addresses?
Then 2 of the unit server in each IP. In each domain a record with the corresponding IP.

2 if domain should refer to the same site on the same IP one unit with one IP, with a bunch of domains in server_name.
Remember, you are not ip connected to domain and domain to IP-to-have, though it's very simple said. - Aylin_Hetting commented on June 14th 19 at 21:12
June 14th 19 at 21:08
IP must designate a controlled network interface, which docked with nginx and everything

then to change the a record ( or add, will be for two to open)
June 14th 19 at 21:10
In your Nginx configuration registers listen;

This means that nginx will be at this address to accept requests FOR ANY DOMAIN.
If you only need for this domain - that is the IP you need to enter in listen is the domain name. Letters.
And if I specify to listen inquiries from he would not accept? In this case, I have to write something like this:
server {

Also where do I put the IP address? I need to IP have specified only 1 specific domain. - Glennie_Beie commented on June 14th 19 at 21:13

Find more questions by tags NginxHosting