"feat: Add SSL configuration and docker-compose updates for frontend"

This commit is contained in:
2025-05-26 07:21:47 +02:00
parent 3b53e78799
commit 0e40ad1c12
6 changed files with 305 additions and 9 deletions

View File

@@ -1,16 +1,26 @@
{
debug
auto_https disable_redirects
}
# Entwicklungsumgebung - Localhost und Raspberry Pi Backend
localhost, 127.0.0.1 {
# API Anfragen zum Raspberry Pi Backend weiterleiten
# Produktionsumgebung - Spezifischer Hostname für Mercedes-Benz Werk 040 Berlin
m040tbaraspi001.de040.corpintra.net {
# TLS mit selbstsignierten Zertifikaten für die Produktionsumgebung
tls internal {
protocols tls1.2 tls1.3
}
# API Anfragen zum Backend (Raspberry Pi) weiterleiten
@api {
path /api/* /health
}
handle @api {
uri strip_prefix /api
reverse_proxy 192.168.0.105:5000 {
reverse_proxy raaspberry:443 {
transport http {
tls
tls_insecure_skip_verify
}
header_up Host {upstream_hostport}
header_up X-Real-IP {remote_host}
header_up X-Forwarded-For {remote_host}
@@ -28,8 +38,54 @@ localhost, 127.0.0.1 {
}
}
# TLS für Entwicklung deaktiviert
tls off
# OAuth Callbacks
@oauth path /auth/login/callback*
handle @oauth {
header Cache-Control "no-cache"
reverse_proxy myp-rp-dev:3000
}
# Produktions-Header
header {
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
X-Content-Type-Options "nosniff"
X-Frame-Options "SAMEORIGIN"
Referrer-Policy "strict-origin-when-cross-origin"
}
}
# Entwicklungsumgebung - Localhost und Raspberry Pi Backend (weiterhin für lokale Entwicklung verfügbar)
localhost, 127.0.0.1 {
# API Anfragen zum Raspberry Pi Backend weiterleiten
@api {
path /api/* /health
}
handle @api {
uri strip_prefix /api
reverse_proxy raaspberry:443 {
transport http {
tls
tls_insecure_skip_verify
}
header_up Host {upstream_hostport}
header_up X-Real-IP {remote_host}
header_up X-Forwarded-For {remote_host}
header_up X-Forwarded-Proto {scheme}
}
}
# Alle anderen Anfragen zum Frontend weiterleiten
handle {
reverse_proxy myp-rp-dev:3000 {
header_up Host {upstream_hostport}
header_up X-Real-IP {remote_host}
header_up X-Forwarded-For {remote_host}
header_up X-Forwarded-Proto {scheme}
}
}
# TLS für lokale Entwicklung
tls internal
# OAuth Callbacks für Entwicklung
@oauth path /auth/login/callback*