Issue ruining nginx inside podman

I’m loosely following this “getting started” video for podman. One of the first things he does is run podman machine init, which I skip because I’m on Linux, then he runs podman run -p 8080:80 docker.io/library/nginx, which starts a container running nginx, with port 8080 forwarded to port 80 on localhost.

However, I cannot hit the server from my host machine. What am I missing?

container looks good…

$ podman container ls
CONTAINER ID  IMAGE                           COMMAND               CREATED         STATUS         PORTS                         NAMES
ef423d3fd69f  docker.io/library/nginx:latest  nginx -g daemon o...  26 minutes ago  Up 26 minutes  0.0.0.0:8080->80/tcp, 80/tcp  sleepy_gauss

My config:

  virtualisation = {
    containers.enable = true;

    podman = {
      enable = true;

      defaultNetwork.settings = {
        dns_enabled = true;
      };
    };
  };

Are you trying to access localhost:8080 or localhost? Should be accessible at localhost:8080. That command forwards 8080 on localhost to 80 inside the container.