H
H
hdtor2019-06-29 13:28:38
Nginx
hdtor, 2019-06-29 13:28:38

Each has its own IP. How?

I have CentOS 7 with nginx, there are two sites, and 2 IPs are allocated to the server, now these sites work on the same IP. How to make sure that each site has its own IP?
The config of one of them, the config of the second site is similar:

server {
    listen  	80;
    server_name site.info www.site.info;

    location / {
        root  /var/www/html/site.info;
        index  index.php;
    try_files $uri $uri/ =404;
    }
  
      location ~ \.php$ {
        root           html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
       fastcgi_param  SCRIPT_FILENAME  //var/www/html/site.info$fastcgi_script_name;
       include        fastcgi_params;
    }

    error_page  500 502 503 504  /50x.html;
    location = /50x.html {
        root  /usr/share/nginx/html;
    }
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sanes, 2019-06-29
@hdtor

listen ip:80;

V
Viktor Taran, 2019-07-01
@shambler81

listen 192.165.55.2:80;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question