Find dockers containers IP and set static IP

I setup Nginx Revers Proxy Manager on my Raspberry Pi 4 / Home Assistant OS

my configuration file :

http:
  server_port: 8443 
  ssl_certificate: /ssl/origin.pem
  ssl_key: /ssl/privkey.pem
  ip_ban_enabled: true
  login_attempts_threshold: 5
  use_x_forwarded_for: true
  trusted_proxies:
    - 127.0.0.1

I need to add the local dockers IPs but I can’t figure out how …
using the SSH add-on and running docker network ls won’t work.

I having a lot of error in my core logs like

 WARNING (MainThread) [asyncio] socket.send() raised exception.

but also

2021-04-14 17:48:50 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 56, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 172, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 74, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 135, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 131, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/http.py", line 43, in get
    return await WebSocketHandler(request.app["hass"], request).async_handle()
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/http.py", line 234, in async_handle
    await self._writer_task
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/http.py", line 82, in _writer
    await self.wsock.send_str(message)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_ws.py", line 300, in send_str
    await self._writer.send(data, binary=False, compress=compress)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/http_websocket.py", line 687, in send
    await self._send_frame(message, WSMsgType.TEXT, compress)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/http_websocket.py", line 656, in _send_frame
    await self.protocol._drain_helper()
  File "/usr/local/lib/python3.8/site-packages/aiohttp/base_protocol.py", line 87, in _drain_helper
    await waiter
  File "/usr/local/lib/python3.8/asyncio/selector_events.py", line 935, in _write_ready
    n = self._sock.send(self._buffer)
BrokenPipeError: [Errno 32] Broken pipe
2021-04-14 17:52:05 WARNING (MainThread) [homeass

Before I had some error like this
2021-04-14 10:34:31 WARNING (MainThread) [homeassistant.components.http.forwarded] Received X-Forwarded-For header from untrusted proxy 172.30.33.7, headers not processed

so I first add 172.30.33.7 in trusted_proxies then I add the subnet in case (172.30.33.0/24)

how can I know what IP NPM add-on is using ? and can I assign a static IP instead ?

in the multicast log

mdns-repeater (6): dev eth0 addr 192.168.3.46 mask 255.255.255.0 net 192.168.3.0
mdns-repeater (6): dev hassio addr 172.30.32.1 mask 255.255.254.0 net 172.30.32.0

192.167.3.x is my IoT VLAN where my home assistant is, but then what is 172.30.32.1? (which is outside the subnet I just added to my proxy)

also where can I add a special config for ngnix and is there some sample ? I’m new to Nginx, I would like to add more stuff but I’m not to sure how.

172.30.0.0 is the sub-network used by docker. Add

- 172.30.0.0/16

to your trusted proxies

1 Like

thank you !