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
1 |
vi /etc/nginx/nginx.conf |
And VirtualHost/server files for each domain located in folders
1 2 |
/etc/nginx/conf.d => on CentOS/RHEL /etc/nginx/sites-available => on Debian/Ubuntu |
Find
1 |
listen 80 |
Replace with
1 |
listen IP_ADDR_HERE:80 |
IP_ADDR_HERE = your server IP address on which you need nginx listen on.
See Nginx
But on using specific IP:port, I get an error saying
nginx: [emerg] bind() to :8200 failed", "errorDetail": "99- Cannot assign requested address"
?See if you have any other service running on port 8200. netstat -lntp command will show all listing ports.