Updatdet Caddyfile

This commit is contained in:
2026-04-15 12:39:46 +02:00
parent b5a3c3fe21
commit 988999c474
3 changed files with 200 additions and 75 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
services: services:
caddy: caddy:
image: caddy:2 image: caddy:latest
container_name: caddy container_name: caddy
restart: unless-stopped restart: unless-stopped
ports: ports:
+130
View File
@@ -0,0 +1,130 @@
#(simpleAuth)
(auth) {
basic_auth {
admin $2a$14$DahHUWD2cKyXJ96sH5VQwuQv1bqmIn0gsdoSaw4mofzfdNY2Y0VsO
}
}
(common) {
encode gzip zstd
header {
X-Frame-Options "SAMEORIGIN"
X-Content-Type-Options "nosniff"
}
}
test.gynther.se {
respond "det fungerar"
}
bazarr.gynther.se {
import common
reverse_proxy http://bazarr:6767
}
prowlarr.gynther.se {
import common
reverse_proxy http://prowlarr:9696
}
radarr.gynther.se {
import common
reverse_proxy http://radarr:7878
}
sonarr.gynther.se {
import common
reverse_proxy http://sonarr:8989
}
jellyfin.gynther.se {
reverse_proxy http://jellyfin:8096
}
qbittorrent.gynther.se {
import common
reverse_proxy 192.168.50.4:8080
}
wetty.gynther.se {
import auth
import common
redir / /wetty
reverse_proxy 172.22.0.6:3000 {
transport http {
websocket
}
}
}
portainer.gynther.se {
reverse_proxy portainer:9000
}
gitea.gynther.se {
import common
reverse_proxy 192.168.50.2:3002
}
# ============================================
# Import Service (Document Converter) - Standalone UI
# ============================================
#import.gynther.se {
# import common
# reverse_proxy recipe-import-service:3000
#}
#
# ============================================
# RECIPE APP + IMPORT SERVICE
# ============================================
recept.gynther.se {
import auth
import common
# === IMPORT SERVICE (Document Converter) ===
# Dessa endpoints måste komma FÖRST innan backend reglerna!
handle /api/recipes/import* {
reverse_proxy recipe-import-service:3000
}
# === RECIPE FRONTEND PROXY ENDPOINTS ===
# Next.js API routes
handle /api/inventory-history-proxy {
reverse_proxy recipe-frontend:3000
}
handle /api/admin/merge-preview-proxy {
reverse_proxy recipe-frontend:3000
}
handle /api/recipe-preview-proxy {
reverse_proxy recipe-frontend:3000
}
# === RECIPE BACKEND API ENDPOINTS ===
# Backend körs på port 8080 (från docker-compose)
handle /api/products* {
reverse_proxy recipe-api:8080
}
handle /api/inventory* {
reverse_proxy recipe-api:8080
}
handle /api/recipes* {
reverse_proxy recipe-api:8080
}
# === HEALTH CHECKS ===
handle /health {
reverse_proxy recipe-api:8080
}
# === CATCH ALL ===
# Övriga /api/* går till frontend
handle /api/* {
reverse_proxy recipe-frontend:3000
}
# Frontend - catch all remaining routes (port 3000)
reverse_proxy /* recipe-frontend:3000
}
+69 -74
View File
@@ -1,132 +1,127 @@
#(simpleAuth) #(simpleAuth)
(auth) { (auth) {
basic_auth { basic_auth {
admin $2a$14$DahHUWD2cKyXJ96sH5VQwuQv1bqmIn0gsdoSaw4mofzfdNY2Y0VsO admin $2a$14$DahHUWD2cKyXJ96sH5VQwuQv1bqmIn0gsdoSaw4mofzfdNY2Y0VsO
} }
} }
(common) { (common) {
encode gzip zstd encode gzip zstd
header { header {
X-Frame-Options "SAMEORIGIN" X-Frame-Options "SAMEORIGIN"
X-Content-Type-Options "nosniff" X-Content-Type-Options "nosniff"
# Säker cookie för sessionhantering }
Set-Cookie "session_id=default; Path=/; SameSite=Lax; Secure; HttpOnly"
}
} }
test.gynther.se { test.gynther.se {
respond "det fungerar" respond "det fungerar"
} }
bazarr.gynther.se { bazarr.gynther.se {
import common import common
reverse_proxy http://bazarr:6767 reverse_proxy http://bazarr:6767
} }
prowlarr.gynther.se { prowlarr.gynther.se {
import common import common
reverse_proxy http://prowlarr:9696 reverse_proxy http://prowlarr:9696
} }
radarr.gynther.se { radarr.gynther.se {
import common import common
reverse_proxy http://radarr:7878 reverse_proxy http://radarr:7878
} }
sonarr.gynther.se { sonarr.gynther.se {
import common import common
reverse_proxy http://sonarr:8989 reverse_proxy http://sonarr:8989
} }
jellyfin.gynther.se { jellyfin.gynther.se {
reverse_proxy http://jellyfin:8096 reverse_proxy http://jellyfin:8096
} }
qbittorrent.gynther.se { qbittorrent.gynther.se {
import common import common
reverse_proxy 192.168.50.4:8080 reverse_proxy 192.168.50.4:8080
} }
wetty.gynther.se { wetty.gynther.se {
import auth import auth
import common import common
redir / /wetty redir / /wetty
reverse_proxy wetty:3001 reverse_proxy wetty:3001
transport http {
websocket # Aktivera WebSocket-stöd
}
} }
portainer.gynther.se { portainer.gynther.se {
reverse_proxy portainer:9000 reverse_proxy portainer:9000
} }
gitea.gynther.se { gitea.gynther.se {
import common import common
reverse_proxy 192.168.50.2:3002 reverse_proxy 192.168.50.2:3002
} }
# ============================================ # ============================================
# Import Service (Document Converter) - Standalone UI # Import Service (Document Converter) - Standalone UI
# ============================================ # ============================================
import.gynther.se { import.gynther.se {
import common import common
reverse_proxy recipe-import-service:3000 reverse_proxy recipe-import-service:3000
} }
# ============================================ # ============================================
# RECIPE APP + IMPORT SERVICE # RECIPE APP + IMPORT SERVICE
# ============================================ # ============================================
recept.gynther.se { recept.gynther.se {
import auth import auth
import common import common
# === IMPORT SERVICE (Document Converter) === # === IMPORT SERVICE (Document Converter) ===
# Dessa endpoints måste komma FÖRST innan backend reglerna! # Dessa endpoints måste komma FÖRST innan backend reglerna!
handle /api/recipes/import* { handle /api/recipes/import* {
reverse_proxy recipe-import-service:3000 reverse_proxy recipe-import-service:3000
} }
# === RECIPE FRONTEND PROXY ENDPOINTS === # === RECIPE FRONTEND PROXY ENDPOINTS ===
# Next.js API routes # Next.js API routes
handle /api/inventory-history-proxy { handle /api/inventory-history-proxy {
reverse_proxy recipe-frontend:3000 reverse_proxy recipe-frontend:3000
} }
handle /api/admin/merge-preview-proxy { handle /api/admin/merge-preview-proxy {
reverse_proxy recipe-frontend:3000 reverse_proxy recipe-frontend:3000
} }
handle /api/recipe-preview-proxy { handle /api/recipe-preview-proxy {
reverse_proxy recipe-frontend:3000 reverse_proxy recipe-frontend:3000
} }
# === RECIPE BACKEND API ENDPOINTS === # === RECIPE BACKEND API ENDPOINTS ===
# Backend körs på port 8080 (från docker-compose) # Backend körs på port 8080 (från docker-compose)
handle /api/products* { handle /api/products* {
reverse_proxy recipe-api:8080 reverse_proxy recipe-api:8080
} }
handle /api/inventory* { handle /api/inventory* {
reverse_proxy recipe-api:8080 reverse_proxy recipe-api:8080
} }
handle /api/recipes* { handle /api/recipes* {
reverse_proxy recipe-api:8080 reverse_proxy recipe-api:8080
} }
# === HEALTH CHECKS === # === HEALTH CHECKS ===
handle /health { handle /health {
reverse_proxy recipe-api:8080 reverse_proxy recipe-api:8080
} }
# === CATCH ALL === # === CATCH ALL ===
# Övriga /api/* går till frontend # Övriga /api/* går till frontend
handle /api/* { handle /api/* {
reverse_proxy recipe-frontend:3000 reverse_proxy recipe-frontend:3000
} }
# Frontend - catch all remaining routes (port 3000) # Frontend - catch all remaining routes (port 3000)
reverse_proxy /* recipe-frontend:3000 reverse_proxy /* recipe-frontend:3000
} }