1. The problem I’m having:
I am trying to get the VueRouter redirections to work eg:. https:///cs2darchive.com/clients
Now I understand somehow I have to redirect each routes to index.html, but I am unsure how to do that with JSON, I only found Caddyfile examples, but those are a bit different huh.
2. Error messages and/or full log output:
HTTP 404 errors whenever I press F5 on any of the VueRouter pages.
3. Caddy version:
v2.8.4
4. How I installed and ran Caddy:
Using Caddy's repository and via apt install caddy
a. System environment:
Ubuntu 24.04 Server on Aarch64 Raspi5 via systemd
b. Command:
sudo caddy run --config global-caddy.json
d. My complete Caddy config:
{
"apps": {
"http": {
"servers": {
"default": {
"listen": [
":80"
],
"routes": [
{
"handle": [
{
"handler": "file_server",
"root": "/path/to/default/root"
}
]
}
]
},
"https": {
"listen": [
":443"
],
"routes": [
{
"handle": [
{
"handler": "file_server",
"root": "/home/marcell/PagerCast/"
}
],
"match": [
{
"host": [
"pager.brohosting.eu"
]
}
]
},
{
"handle": [
{
"handler": "file_server",
"root": "/home/marcell/PagerCast/"
}
],
"match": [
{
"host": [
"asf.raspberry.local"
]
}
]
},
{
"handle": [
{
"handler": "file_server",
"root": "/home/marcell/PagerCast/"
}
],
"match": [
{
"host": [
"pagercast.com",
"api.pagercast.com",
"www.pagercast.com"
]
}
]
},
{
"handle": [
{
"handler": "file_server",
"root": "/home/marcell/_domains/cs2darchive.com/dist"
}
],
"match": [
{
"host": [
"cs2darchive.com",
"www.cs2darchive.com"
],
"not": [
{
"path": [
"/api/*"
]
}
]
}
]
},
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "localhost:3415"
}
]
}
],
"match": [
{
"host": [
"cs2darchive.com",
"www.cs2darchive.com"
],
"path": [
"/api/*"
]
}
]
},
{
"handle": [
{
"handler": "file_server",
"root": "/home/marcell/_domains/verify.gtavc.cc/dist"
}
],
"match": [
{
"host": [
"verify.gtavc.cc"
],
"not": [
{
"path": [
"/api/v1/*"
]
}
]
}
]
},
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "localhost:3000"
}
]
}
],
"match": [
{
"host": [
"verify.gtavc.cc"
],
"path": [
"/api/v1/*"
]
}
]
}
],
"tls_connection_policies": [
{
"certificate_selection": {
"any_tag": [
"default"
]
}
}
]
}
}
},
"tls": {
"certificates": {
"load_files": [
{
"certificate": "/home/marcell/PagerCast/certs/cert.pem",
"key": "/home/marcell/PagerCast/certs/privkey.pem",
"tags": [
"default"
]
}
]
}
}
}
}