nginx change port code example

Example 1: cancel ng server port

Using your terminal, find the PID of port 4200
netstat -ano | findstr :4200

Kill task by the PID Number (Replace 15940)
taskkill /PID 15940 /F

Example 2: chaneg default port on nginx

# vi /etc/nginx/sites-enabled/default  [On Debian/Ubuntu]
# vi /etc/nginx/nginx.conf             [On CentOS/RHEL]

Example 3: chaneg default port on nginx

# systemctl restart nginx
# netstat -tlpn| grep nginx
# ss -tlpn| grep nginx

Example 4: chaneg default port on nginx

listen 3200 default_server;

Tags:

Misc Example