I am running services on WSL2 and encountering an issue where I can ping the WSL2 instance from my Windows host, but I cannot connect to services like Nginx, Redis, or a Python server running on specific ports.
Here are the details:
Services Running:
Nginx
Redis
Python server on port 8000
MySQL container (started via Docker)
Service Status:
All services are running and listening on the expected ports. For example, netstat shows Nginx listening on port 80 and Redis on port 6379.
Configurations:
I have verified that the configuration files for Nginx and Redis are correct and free of syntax errors.
Ports are open in WSL2’s firewall (ufw), and I’ve allowed traffic on these ports.
Network Configuration:
The WSL2 instance can be pinged from Windows.
Ports are correctly mapped, and MySQL running in Docker is accessible.
Issue:
Despite being able to ping the WSL2 instance, I cannot access Nginx or Redis from Windows. For example, accessing http://myip:80 or http://myip::6379 fails to connect.
I have also tested with a Python server listening on port 8000, and it faces the same issue. However, MySQL in Docker is accessible from Windows using the relevant tools.
What I’ve Tried:
Verified service status and configuration files.
Checked and allowed ports in WSL2’s firewall.
Restarted WSL2 and services multiple times.
Ensured Docker MySQL container is accessible.
Could anyone help me troubleshoot why these services are not accessible from Windows, despite being reachable via ping?
xunxxmo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.