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

    4
    0
    1
    Jul 29, 2020
    Ratings:
    +0
    Local Time:
    5:03 AM
    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

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    9:33 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    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

    4
    0
    1
    Jul 29, 2020
    Ratings:
    +0
    Local Time:
    5:03 AM
    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

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    9:33 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    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