OCI: How To Disable IPv6 Listening on Port 80 for Nginx
in Linux
Applies To:
Oracle Cloud Infrastructure
Linux x86-64
Goal:
In a OCI Oracle Linux instance where both IPv4 and IPv6 are enabled by default, when installing and starting nginx web server from the Oracle provided repository packages, the service listens by default on port 80 both using IPv4 and IPv6:
# netstat -tanp | grep nginx
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 32494/nginx: master
tcp6 0 0 :::80 :::* LISTEN 32494/nginx: master
This is the default behavior, and it is to be expected. But in this case there is a specific need to only listen on the IPv4 address.
Solution:
To disable listening on port 80 using IPv6 in a standard installation of nginx:
Tagged:
0