mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-30 03:46:29 -05:00
Redirecting to Controller when main react app is down.
This commit is contained in:
parent
08982647ac
commit
8261df5bef
3 changed files with 34 additions and 31 deletions
|
|
@ -25,6 +25,10 @@
|
|||
:443 {
|
||||
tls /etc/ssl/caddy/cert.crt /etc/ssl/caddy/cert.key
|
||||
|
||||
header Access-Control-Allow-Origin "*"
|
||||
header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"
|
||||
header Access-Control-Allow-Headers "Content-Type, Accept"
|
||||
|
||||
handle /favicon.ico {
|
||||
root * /etc/caddy
|
||||
rewrite * /favicon.ico
|
||||
|
|
@ -84,13 +88,11 @@
|
|||
|
||||
# React app with fallback to Controller.
|
||||
handle {
|
||||
reverse_proxy app:3000 {
|
||||
@bad status 502 503 504
|
||||
handle_response @bad {
|
||||
header Location /controller/?fallback=true
|
||||
respond "" 302
|
||||
}
|
||||
}
|
||||
reverse_proxy app:3000
|
||||
}
|
||||
|
||||
handle_errors 502 503 504 {
|
||||
redir * "http://{host}:8087/?fallback=true" 302
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue