Skip to content

Commit

Permalink
I think that might have done it
Browse files Browse the repository at this point in the history
  • Loading branch information
Dokotela committed Nov 20, 2024
1 parent 4eeda64 commit c7aa178
Show file tree
Hide file tree
Showing 4 changed files with 251 additions and 307 deletions.
90 changes: 0 additions & 90 deletions assets/mimic_iv/split_mimic.go

This file was deleted.

48 changes: 14 additions & 34 deletions config/caddy/Caddyfile.fhirant
Original file line number Diff line number Diff line change
@@ -1,52 +1,32 @@
# Listen on port 8081 for HTTP requests
10.0.0.16:8081 {
# Set the root directory for serving files, such as certificates
# Serve files at 10.0.2.16:8081 for browsing
10.0.2.16:8081 {
root * /absolute/path/to/storage/pki/authorities/local

# Enable file server to serve static files like root.crt
handle_path /certs/* {
file_server browse
}

# Reverse proxy configuration for PocketBase
handle {
reverse_proxy 127.0.0.1:8090 {
transport http {
read_timeout 360s
}
}
}

# Logging setup
log {
output file /absolute/path/to/storage/caddy_debug.log {
roll_size 5MiB
roll_keep 10
roll_keep_for 720h
}
# Enable logging with a dedicated log path for certs access
log certs {
output file /path/to/logs/certs_access.log
format json
}
}

# HTTPS server block for serving PocketBase via HTTPS
10.0.2.16:8443 {
# Enable TLS with automatic certificates (use internal certificates for testing)
# Reverse proxy at 10.0.2.16:55000 with TLS internal
10.0.2.16:55000 {
tls internal

# Set up reverse proxy for HTTPS
# Reverse proxy configuration with health checks
reverse_proxy 127.0.0.1:8090 {
transport http {
read_timeout 360s
}
health_interval 10s
health_timeout 2s
health_uri /health
}

# Logging setup for HTTPS server
log {
output file /absolute/path/to/storage/caddy_https_debug.log {
roll_size 5MiB
roll_keep 10
roll_keep_for 720h
}
# Enable logging with a dedicated log path for the proxy
log pb_proxy {
output file /path/to/logs/proxy_access.log
format json
}
}
156 changes: 63 additions & 93 deletions config/caddy/temp.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,34 @@
{
"logging": {
"logs": {
"default": {
"exclude": [
"http.log.access.log0",
"http.log.access.log1"
]
},
"log0": {
"certs": {
"writer": {
"filename": "/absolute/path/to/storage/caddy_debug.log",
"output": "file",
"roll_keep": 10,
"roll_keep_days": 30,
"roll_size_mb": 5
"filename": "/path/to/logs/certs_access.log",
"output": "file"
},
"encoder": {
"format": "json"
},
"include": [
"http.log.access.log0"
"http.log.access.certs"
]
},
"log1": {
"default": {
"exclude": [
"http.log.access.certs",
"http.log.access.pb_proxy"
]
},
"pb_proxy": {
"writer": {
"filename": "/absolute/path/to/storage/caddy_https_debug.log",
"output": "file",
"roll_keep": 10,
"roll_keep_days": 30,
"roll_size_mb": 5
"filename": "/path/to/logs/proxy_access.log",
"output": "file"
},
"encoder": {
"format": "json"
},
"include": [
"http.log.access.log1"
"http.log.access.pb_proxy"
]
}
}
Expand All @@ -44,14 +38,14 @@
"servers": {
"srv0": {
"listen": [
":8081"
":55000"
],
"routes": [
{
"match": [
{
"host": [
"10.0.0.16"
"10.0.2.16"
]
}
],
Expand All @@ -62,68 +56,17 @@
{
"handle": [
{
"handler": "vars",
"root": "/absolute/path/to/storage/pki/authorities/local"
}
]
},
{
"group": "group2",
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "rewrite",
"strip_path_prefix": "/certs"
}
]
},
{
"handle": [
{
"browse": {},
"handler": "file_server",
"hide": [
"./Caddyfile.fhirant"
]
}
]
"handler": "reverse_proxy",
"health_checks": {
"active": {
"interval": 10000000000,
"timeout": 2000000000,
"uri": "/health"
}
]
}
],
"match": [
{
"path": [
"/certs/*"
]
}
]
},
{
"group": "group2",
"handle": [
{
"handler": "subroute",
"routes": [
},
"upstreams": [
{
"handle": [
{
"handler": "reverse_proxy",
"transport": {
"protocol": "http",
"read_timeout": 360000000000
},
"upstreams": [
{
"dial": "127.0.0.1:8090"
}
]
}
]
"dial": "127.0.0.1:8090"
}
]
}
Expand All @@ -137,15 +80,15 @@
],
"logs": {
"logger_names": {
"10.0.0.16": [
"log0"
"10.0.2.16": [
"pb_proxy"
]
}
}
},
"srv1": {
"listen": [
":8443"
":8081"
],
"routes": [
{
Expand All @@ -163,17 +106,44 @@
{
"handle": [
{
"handler": "reverse_proxy",
"transport": {
"protocol": "http",
"read_timeout": 360000000000
},
"upstreams": [
"handler": "vars",
"root": "/absolute/path/to/storage/pki/authorities/local"
}
]
},
{
"handle": [
{
"handler": "subroute",
"routes": [
{
"dial": "127.0.0.1:8090"
"handle": [
{
"handler": "rewrite",
"strip_path_prefix": "/certs"
}
]
},
{
"handle": [
{
"browse": {},
"handler": "file_server",
"hide": [
"./Caddyfile.fhirant"
]
}
]
}
]
}
],
"match": [
{
"path": [
"/certs/*"
]
}
]
}
]
Expand All @@ -185,7 +155,7 @@
"logs": {
"logger_names": {
"10.0.2.16": [
"log1"
"certs"
]
}
}
Expand Down
Loading

0 comments on commit c7aa178

Please sign in to comment.