nginx doesn't listen on port 80 twice?

后端 未结 4 1422
离开以前
离开以前 2020-12-11 09:34

Edit: Read this, first:

Apart from the accepted answer, these errors occur when nginx is started without systemd. Kill nginx: ps -ax | grep nginx

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-11 10:06

    You can't run two applications on the same address with the same port.

    What you need to do is just change port of your application one with 80 and other application with some other port say 3000.

    If you want your application to run only with 80 port than just remove the default file from

    /etc/nginx/sites-available/default

    and optionally also from

    /etc/nginx/sites-enabled/default

    You can run

    sudo rm -rf /etc/nginx/sites-available/default

    sudo rm -rf /etc/nginx/sites-enabled/default

    Now you will be able to run one of your application on port 80

提交回复
热议问题