Symptom : The NGiNX web server is started by default listening to port 80 .
How do I change it to start listening by default to a different port .
Solution : Since NGiNX might be installed with another web server like apache that already listens on port 80 ,
Or you just want NGiNX to listen on a different port like 81 , you need to configure the following :
Go to /etc/nginx/conf.d and edit the file default.conf .
In the file you will see the lines :
server {
listen 80 default_server;
Change it to :
server {
listen 81 default_server;
Restart the server :
/etc/init.d/nginx restart