Fluxheim/Doku/Reverse Proxy

Reverse Proxy

Setz Fluxheim vor an Anwendungsserver. Fluxheim übernimmt TLS, Header, Limits und d Upstream-Auswahl.

Basic proxy

[[vhosts]]
name = "app"
hosts = ["app.example.com"]

[[vhosts.routes]]
path_prefix = "/"
action = "proxy"
upstreams = ["127.0.0.1:3000"]

Routenauswahl

Feature-BereichNutz es, wenn
path_exactA URL braucht a präzise Route.
path_prefixA ganzer URL-Unterbaum geht an a Backend.
strip_prefixS Backend soi den öffentlichen Prefix ned segn.
rewrite_prefixS Backend erwartet an andern internen Prefix.
methodsA Route soi bloß ausgewählte HTTP-Methoden akzeptiern.

Beispiel fur Pfad-Rewrite

[[vhosts.routes]]
name = "api"
path_prefix = "/api/"
strip_prefix = "/api/"
rewrite_prefix = "/internal/"

[vhosts.routes.proxy]
upstreams = ["10.0.0.20:8080"]
connect_timeout_secs = 5
read_timeout_secs = 30
send_timeout_secs = 30

CORS fia Browser-Apps

Schalt CORS bloß ei, wenn Browser-Apps vo bekannten Ursprüngen de Route aufruafa miassn.

[headers.cors]
enabled = true
allow_origins = ["https://app.example.com"]
allow_methods = ["GET", "HEAD", "POST"]
allow_headers = ["authorization", "content-type"]
allow_credentials = true
max_age_secs = 600
  • Fluxheim beantwortet gültige Preflight-Anfragen lokal; abglehnte Preflights gebn 403 zruck, ohne de Anwendung z erreicha.
  • Kombinier koan Wildcard-Ursprung mit Anmeldedatn.
  • CORS is koa Authentifizierung, Autorisierung oder CSRF-Schutz.

Produktionshinweise

  • Hoib d Anwendung auf Loopback oder in am privaten Netzwerk.
  • Setz Request-Body-Limits, bevorst Uploads freigibst.
  • Use trusted proxy settings only for networks you control.
  • Nimm explizite Routen statt am großen Fallback, wenn Pfade unterschiedliche Sicherheitsregeln brauchn.
Boarisch