Discover Centmin Mod today
Register Now

How to change nginx port

Discussion in 'Install & Upgrades or Pre-Install Questions' started by OxaByte.com, Aug 1, 2020.

  1. OxaByte.com

    OxaByte.com New Member

    3
    0
    1
    Jul 29, 2020
    Ratings:
    +0
    Local Time:
    3:45 PM
    I want to change port of nginx to something else. I tried to change ports in vhost but when I start nginx it starts on port 80 again. How to completely disable it
     
  2. eva2000

    eva2000 Administrator Staff Member

    45,183
    10,276
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,926
    Local Time:
    8:15 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    which nginx vhost file are you trying to change and how are you changing it ? what is the before versus after changes look like ?
     
  3. OxaByte.com

    OxaByte.com New Member

    3
    0
    1
    Jul 29, 2020
    Ratings:
    +0
    Local Time:
    3:45 PM
    I am change port 80 to 8080 inside vhost all. I did for all vhost file but when I restart nginx it opens on port 80 as well as port 8080
     
  4. eva2000

    eva2000 Administrator Staff Member

    45,183
    10,276
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,926
    Local Time:
    8:15 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    check any vhost config file in /usr/local/nginx/conf/conf.d/ which has a server{} context without a listen directive as absence of a listen directive is same as listen port 80. Then specifically in that vhost add a listen directive to the custom port