What already works
Visiting / should show a normal website (works)
pllx.eu:80 {
tls off
root pllx.eu-website/
}
Visiting /statistics should show a proxied website (works)
pllx.eu:80/statistics {
proxy / http://localhost:3000 {
header_downstream Content-Type text/plain
}
}
What doesnt work / What I tried / How it should work
Visiting pllx.eu/id/key should send a file
The problem is that id and key are variables and not static values
Visiting https://pllx.eu/EWkvBH/JzTUXuWQJqDGdzj3 should show an image or send a file
Its a regular GET request on /:id/:key
pllx.eu:80/{id}/{key} {
tls off
proxy / http://localhost:3000 {
header_upstream Host {host}
header_upstream X-Real-IP {remote}
header_upstream X-Forwarded-For {host}
header_upstream X-Forwarded-Proto {scheme}
header_downstream Content-Type {>Header}
}
}
Sending a POST request on /upload should give you a text/plain callback, but I think I can figure this out by myself when someone of you can help me with the variable query problem.
Thanks to everyone who answers, I love caddyserver.
~ Stan