[BUG] Quadlet curl vs nginx behavior

Abierto
#630 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
1-2 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
docker, dockerfile, linux, nginx

Línea de trabajo

The failing piece is the proxy_pass $upstream_proto://$upstream_app:$upstream_port; line in the nginx site config, where realhost does not resolve inside the SWAG container while curl realhost:8080 works. Start by comparing name resolution inside the container (getent hosts realhost, /etc/hosts, /etc/resolv.conf) with the Quadlet unit that sets Network=host. Done means finding why nginx resolves the name differently and either fixing the configuration or documenting the workaround; the issue does not yet state a required change.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

no-issue-activity
Is there an existing issue for this?
  • I have searched the existing issues
Current Behavior

When running on a machine called "realhost", executing curl realhost:8080 nets the correct webpage.
But when nginx is told to connect to realhost:8080 using the below configuration it fails. Replacing realhost with 127.0.0.1 works properly. This is running with network mode = host.

        set $upstream_app realhost;
        set $upstream_port 8080; 
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;
Expected Behavior

if curl can resolve and get the webpage then so should nginx.

Steps To Reproduce
  1. Run with a podman quadlet:
  2. Enter container. Run curl targeting hostname that container is running on
  3. use the same hostname in curl. Fails
  4. use 127.0.0.1 instead of hostname or localhost. Works
Environment
- OS: Debian 13
- How docker service was installed: sudo apt install podman
CPU architecture

x86-64

Docker creation
[Unit]
Description=SWAG container.
Wants=network-online.target
After=network-online.target

[Container]
Image=lscr.io/linuxserver/swag:latest
ContainerName=swag
AutoUpdate=registry

Network=host
AddCapability=NET_ADMIN
Environment=TZ=Europe/Amsterdam
Environment=URL=maindomain.tld
Environment=EXTRA_DOMAINS=*.domain.tld
Environment=VALIDATION=dns
Environment=SUBDOMAINS=wildcard
Environment=DNSPLUGIN=provider
Environment=SWAG_AUTORELOAD=true

Environment=DOCKER_MODS=linuxserver/mods:swag-dashboard

Volume=/srv/swag:/config:Z

LogDriver=journald


[Service]
Restart=always
ExecStartPre=mkdir -p /srv/swag

[Install]
WantedBy=default.target
Container logs
[mod-init] Running Docker Modification Logic
[mod-init] Adding linuxserver/mods:swag-dashboard to container
[mod-init] Downloading linuxserver/mods:swag-dashboard from lscr.io
[mod-init] Installing linuxserver/mods:swag-dashboard
[mod-init] linuxserver/mods:swag-dashboard applied to container
[migrations] started
[migrations] 01-nginx-site-confs-default: skipped
[migrations] 02-swag-old-certbot-paths: skipped
[migrations] done
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support the app dev(s) visit:
Certbot: https://supporters.eff.org/donate/support-work-on-certbot

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    911
User GID:    911
───────────────────────────────────────
Linuxserver.io version: 5.8.0-ls489
Build-date: 2026-10-10T09:44:35+00:00
───────────────────────────────────────
    
using keys found in /config/keys
**** The following active confs have different version dates than the samples that are shipped. ****
**** This may be due to user customization or an update to the samples. ****
**** You should compare the following files to the samples in the same folder and update them. ****
**** Use the link at the top of the file to view the changelog. ****
┌────────────┬────────────┬────────────────────────────────────────────────────────────────────────┐
│  old date  │  new date  │ path                                                                   │
├────────────┼────────────┼────────────────────────────────────────────────────────────────────────┤
│ 2025-06-08 │ 2026-09-08 │ /config/nginx/tinyauth-server.conf                                     │
│ 2025-12-17 │ 2026-07-19 │ /config/nginx/tinyauth-location.conf                                   │
└────────────┴────────────┴────────────────────────────────────────────────────────────────────────┘
Variables set:
PUID=
PGID=
TZ=Europe/Amsterdam
URL=maindomain.tld
SUBDOMAINS=wildcard
EXTRA_DOMAINS=*.domain.tld
ONLY_SUBDOMAINS=false
VALIDATION=dns
CERTPROVIDER=
CERT_PROFILE=
DNSPLUGIN=provider
EMAIL=
STAGING=

Using Let's Encrypt as the cert provider
SUBDOMAINS entered, processing
Wildcard cert for maindomain.tld will be requested
EXTRA_DOMAINS entered, processing
Extra domains processed are: domain.tld
No e-mail address entered or address invalid
dns validation via transip plugin is selected
Certificate exists; parameters unchanged; starting nginx
The cert does not expire within the next day. Letting the cron script handle the renewal attempts.
**** Applying the SWAG dashboard mod... ****
**** Adding goaccess to package install list ****
**** libmaxminddb already installed, skipping ****
**** Applied the SWAG dashboard mod ****
[pkg-install-init] **** Installing all mod packages ****
(1/1) Installing goaccess (1.10.2-r0)
Executing busybox-1.37.0-r31.trigger
OK: 207.6 MiB in 219 packages
[custom-init] No custom files found, skipping...
Auto-reload: Watching the following folders for changes to .conf files:
/config/nginx
[ls.io-init] done.
2026/10/15 13:24:28 [warn] 858#858: conflicting server name "_" on 0.0.0.0:443, ignored
2026/10/15 13:24:28 [warn] 858#858: conflicting server name "_" on [::]:443, ignored
Server ready
Lenguaje dominante
Dockerfile
Estrellas
3.8k
Forks
274
Merge medio
25 min
PR fusionados (30 d)
1

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de linuxserver/docker-swag

Todos los issues de linuxserver/docker-swag

Issues similares

Más issues de DevOps

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.