To configure and install Nginx with IPv6 networking support on a Debian-based system, follow these steps:
- Install Nginx:
sudo apt-get update
sudo apt-get install nginx
- Verify that Nginx is installed by visiting the IP address of your server in a web browser.
- To enable IPv6 support in Nginx, open the Nginx configuration file:
sudo nano /etc/nginx/nginx.conf
- Find the following line in the file:
listen 80;
This line tells Nginx to listen for incoming connections on port 80. To add IPv6 support, change the line to the following:
listen [::]:80;
- Save and close the file.
- Restart Nginx to apply the changes:
sudo service nginx restart
- Verify that Nginx is listening for IPv6 connections by using the following command:
sudo netstat -tlp | grep nginx
The output should show that Nginx is listening on both IPv4 and IPv6.
That’s it! You have now installed and configured Nginx with IPv6 networking support on a Debian-based system.