[BUG] Quadlet curl vs nginx behavior

Đang mở
#630 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
docker, dockerfile, linux, nginx
Lĩnh vực
devops, networking

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
Dockerfile
Star
3.8k
Fork
274
Merge trung bình
25 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của linuxserver/docker-swag

Tất cả issue của linuxserver/docker-swag

Issue tương tự

Thêm issue về DevOps

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.