- Show all Docs ( 243 ) Collapse Docs
- Show all Docs ( 23 ) Collapse Docs
How to change NGINX port in Linux
Step 1: Check the default port by accessing the server IP address in the browser .
Step 2: Login into the server using root credentials through putty .
Step 3: Open Nginx configuration file with a text editor .
# vi /etc/nginx/nginx.conf
Press ‘ I ’ for the insert/modification mode .
Step 4: Change the default port of the nginx to the custom port
Before change : port is 80 as shown below in screetshot
After change : Port has been changed to 8081 (here) as shown in screenshot
Step 5 Restart the nginx and network service .
# systemctl status nginx
# systemctl status network
Step 6: Now check the webserver while accessing the server IP_address:8081 in the browser.
Thank You 🙂