-
Notifications
You must be signed in to change notification settings - Fork 850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WSL 2 Linux host cannot be accessed by a custom domain name or 127.0.0.1 #5728
Comments
same |
I think i have the same issue but not with docker i did upgrade my wsl from 1 to 2 almost allworking smoothly but connection to wsl is not so easy .. in my ubuntu wsl there is installed apache so when i try to connect i have this beavhior: http://localhost/ <- WORK i use tcp dump to check in coming connection and it look like with 127.0.0.1 i try to check if there is other windows app which use port 80 but i got just this ` Get-Process -Id (Get-NetTCPConnection -LocalPort 80).OwningProcess Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName
this is big problem because i have different sites to reach according to domain name.. so on hosts of windows i setup the dns but since i cant use 127.0.0.1 because is not working i need use wsl ipaddress which keep change everytime i restart the machine.... |
Having similar issues with OS Build 20185.1000, on WSL2 Ubuntu 18.04.5 LTS (Release 18.04). Trying to access a docker container running in my linux version of docker, and I can access the page using EDIT: Turns out this is probably due to IP allocation being different, or something. If I find the IP of Ubuntu's |
As I posted here: #4150 (comment) 127.0.0.1 does not work but its alter-ego ::1 actually work. You can use http://[::1] ! And you can add a custom domain to your hosts:
|
Unfortunately this doesn't work with my current setup (perhaps due to my docker containers) |
@Rainbowlemon I'm using it with docker (inside WSL2). I actually use a router on port 80 inside my docker and it works using https://custom.wip. Here is a sample of what I did if it can help: # docker-compose.yaml
services:
router:
build: docker/router
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
ports:
- 80:80
- 443:443
game:
image: game-dev:latest
build:
target: builder
volumes:
- .:/workdir
labels:
- "traefik.enable=true"
- "traefik.http.routers.game.rule=Host(`gangbowl.local`)"
- "traefik.http.routers.game.tls=true"
- "traefik.http.routers.game-unsecure.rule=Host(`game.local`)"
# Comment the next line to be able to access frontend via HTTP instead of HTTPS
- "traefik.http.routers.game-unsecure.middlewares=redirect-to-https@file" I even used mkcert for the certificates and it worked! :) # Makefile
prepare.windows: ## Prepare your system for Gangbowl
sudo ./build/tools/gang_domain.sh # This setup the hosts!
./build/tools/mkcert.exe -install
./build/tools/mkcert.exe -cert-file docker/router/etc/ssl/certs/game.wip.pem -key-file docker/router/etc/ssl/certs/game.wip-key.pem "game.local" |
Hi! We've identified this issue as a duplicate of another one that already exists in this repository. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! |
#4210 (comment) in WSL run: copy that IP into your windows etc/hosts file to point to a custom domain of your choice Example in etc/hosts of windows host: |
This works for me. In the files of
|
Environment
Windows 10 Professional Insider Preview Build 20180.1000
WSL 2: Ubuntu 20.04 (Linux MSI 4.19.121-microsoft-standard #1 SMP Fri Jun 19 21:06:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux)
Steps to reproduce
I follow this document: https://docs.nvidia.com/cuda/wsl-user-guide/index.html
NVIDIA GPU Docker support installed in WSL 2.
Everything went well, I successfully used RTX 2080 for calculations in WSL 2 Docker.
But when I tried to access the service in Docker on windows, there was a problem.
If I execute curl localhost on the Windows command line, I can access the http (jupyter) service in Docker, but when I customize the domain name in hosts that points to 127.0.0.1, this domain name cannot be used normally when it is accessed Up.
Expected behavior
Successfully use my custom domain name to access the docker service
Actual behavior
The server rejected our connection request.
The text was updated successfully, but these errors were encountered: