Configure Nginx to listen on single IP Address

By default Nginx listens on all IP address on a server. To make nginx listen on specific IP address, edit nginx configuration file

vi /etc/nginx/nginx.conf

And VirtualHost/server files for each domain located in folders

/etc/nginx/conf.d => on CentOS/RHEL
/etc/nginx/sites-available => on Debian/Ubuntu

Find

Advertisement

listen 80

Replace with

listen IP_ADDR_HERE:80

IP_ADDR_HERE = your server IP address on which you need nginx listen on.

Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement