Get the most out of your Centmin Mod LEMP stack
Become a Member

Nginx moving server to another IP

Discussion in 'Install & Upgrades or Pre-Install Questions' started by hitman, Nov 1, 2015.

  1. hitman

    hitman Member

    110
    9
    18
    Jul 18, 2014
    Ratings:
    +13
    Local Time:
    8:45 AM
    hello
    can you please let me know of what do i need to change if i move to another IP

    thank you
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,142
    6,781
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,131
    Local Time:
    3:45 PM
    Nginx 1.13.x
    MariaDB 5.5
    you need to change or specify a specific listen directive in your site's http and https vhost conf files

    Code:
    server {
      server_name domain.com www.domain.com;
    
    or

    Code:
    server {
      listen 80;
      server_name domain.com www.domain.com;
    
    becomes

    Code:
    server {
      listen IPADDRESSS:80;
      server_name domain.com www.domain.com;
    
    where IPADDRESS is your ip address other than main server IP which is default set if listen directive is not mentioned or an listen directive without an IP address listed

    then restart nginx server

    details outlined at Module ngx_http_core_module