Skip to content

host.docker.internal is not resolved by nginx #259

Description

@devployment

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    ✔️
  • Are you sure you're not using someone else's docker image?
    ✔️

Describe the bug

host.docker.internal is not resolved by nginx

To Reproduce

Steps to reproduce the behavior:

  1. Run NPM
  2. Run some web application on the Docker host (e.g. on port 5000)
  3. Use host.docker.internal as target

image

  1. Try to access the proxied host.docker.internal:5000
  2. Target page is not displayed and error is logged
2019/12/15 19:47:17 [error] 998#998: *368 host.docker.internal could not be resolved (3: Host not found), client: 192.168.16.1, server: xxx.local.test, request: "GET / HTTP/2.0", host: "xxx.local.test", referrer: "http://localhost:81/nginx/proxy"

Expected behavior

The NPM proxied domain, should show the page running under 127.0.0.1 on the Docker host

Workaround

If I ping host.docker.internal on the running app container and use the resulting IP as target it works

image

Operating System

macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions