0

I have set up the Vagrantfile to use a public network with IP address 192.168.1.10 :

# -*- mode: ruby -*-
# vi: set ft=ruby :


Vagrant.configure("2") do |config|

  config.vm.box = "laravel/homestead"


  config.vm.network "public_network", ip: "192.168.1.10"

 
  
  config.vm.provider "virtualbox" do |vb|
      vb.name = "Agent1"
  end
  config.vm.provision "docker" do |vb|

  end
  config.vm.hostname = "Agent1"
 
end

I have launched the Docker container with the command docker run -it -p 88:80 nginx to map port 80 inside the container to port 88 on the host machine. However, when I try to access the web server using URLs like 192.168.1.10:88, localhost:88, or 127.0.0.1:88 in my web browser, it doesn't work.

What could be causing this issue, and what URL should I use to access the NGINX web server from my Windows host machine?

Khaled Boussoffara
  • 1,567
  • 2
  • 25
  • 53
  • Show the Dockerfile you're using and if it's a plain nginx image from Dockerhub, show where you have exposed port 88. Docker containers have their own network. You can find ip by doing `docker inspect` – UnderDog Apr 10 '23 at 14:19
  • 1
    I'm directly pulling nginx:latest from dockerhub without dockerfile ,i inspected the nginx container but i didn't get any informations about network – Khaled Boussoffara Apr 10 '23 at 14:44
  • I still think it's a rabbit hole, but first google search result: https://stackoverflow.com/q/17157721/1294911 – UnderDog Apr 11 '23 at 02:55
  • Windows can run Docker or Nginx on its own. Why do you need a VM? – OneCricketeer Apr 30 '23 at 14:09

1 Answers1

0

You've not forwarded port 88 on the VM to your host.

First check you can SSH into that machine and curl localhost:88

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245