Unable to proxy for container with host mode networking in Swarm
Author: YoshiWalshCreated Sep 22, 2026Updated Sep 22, 2026
Hi, I am running nginx-proxy on Docker Swarm. I would like to configure the proxy for a Music Assistant container I have running. Music Assistant requires host networking, but based on the docs this should work fine.
Here's my Music Assistant service declaration:
services:
music-assistant-server:
image: ghcr.io/music-assistant/server:latest
container_name: music-assistant-server
restart: unless-stopped
network_mode: host
networks:
- host
volumes:
- /mnt/nas/working/mass:/data/
cap_add:
- SYS_ADMIN
- DAC_READ_SEARCH
security_opt:
- apparmor:unconfined
environment:
# default=info, possible=(critical, error, warning, info, debug)
- LOG_LEVEL=info
- VIRTUAL_HOST=ma.example.com
- VIRTUAL_PORT=8095
networks:
host:
name: "host"
external: trueAnd here's the generated /etc/nginx/conf.d/default.conf file from my nginx-proxy container:
# ma.example.com/
upstream ma.example.com {
# Container: musicassistant_music-assistant-server.1.8itsyi7pc4l3s6tb7kx6ilguy
# networks:
# host (unreachable)
# IPv4 address: (none usable)
# IPv6 address: (none usable)
# exposed ports (first ten): 8095/tcp
# default port: 8095
# using port: 8095
# Fallback entry
server 127.0.0.1 down;
}As you can see, it isn't able to find the address for the Music Assistant container. This is using nginx-proxy version 1.11.6-8-gd1a44f5.
Thanks, Yoshi
Source: nginx-proxy/nginx-proxy