Ursache des 404 bei Zugriff über IP/Proxy: .NET-HttpListener bedient den Prefix http://localhost:8077/ nur bei Host: localhost. socat (L4) reicht den originalen Host-Header durch -> 404. Jetzt sitzt ein winziger nginx im Container davor, der den Host-Header auf localhost umschreibt (Upstream [::1]:8077, IPv4 als Fallback). App-Code bleibt unverändert. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
32 lines
963 B
Nginx Configuration File
32 lines
963 B
Nginx Configuration File
# Interner Reverse-Proxy im Container.
|
|
# Zweck: den Host-Header auf "localhost" umschreiben. Die App bindet den
|
|
# HttpListener-Prefix http://localhost:8077/ und bedient NUR Requests mit
|
|
# Host: localhost - ohne dieses Rewrite kaeme von aussen 404.
|
|
worker_processes 1;
|
|
events { worker_connections 1024; }
|
|
|
|
http {
|
|
access_log /dev/stdout;
|
|
error_log /dev/stderr;
|
|
|
|
# App-Listener: bevorzugt IPv6-Loopback (so bindet HttpListener "localhost"
|
|
# im Container), IPv4 als Fallback.
|
|
upstream imapp {
|
|
server [::1]:8077;
|
|
server 127.0.0.1:8077 backup;
|
|
}
|
|
|
|
server {
|
|
listen 8080;
|
|
listen [::]:8080;
|
|
|
|
location / {
|
|
proxy_pass http://imapp;
|
|
proxy_set_header Host localhost; # <- der entscheidende Punkt
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Connection "";
|
|
proxy_read_timeout 300s; # Device-Code-Login/Graph koennen dauern
|
|
}
|
|
}
|
|
}
|