25 lines
550 B
Django/Jinja
25 lines
550 B
Django/Jinja
{{ host }} {
|
|
# Match and proxy API routes
|
|
@apiRoutes {
|
|
path_regexp ^/(api|token|refresh|db-image)
|
|
}
|
|
handle @apiRoutes {
|
|
reverse_proxy @apiRoutes {{ host_directory }}:80
|
|
}
|
|
|
|
# Match requests that end with .js, .css, .ico, or .html
|
|
@staticFiles {
|
|
path_regexp \.(js|css|ico|html)$
|
|
}
|
|
handle @staticFiles {
|
|
rewrite * /static{uri}
|
|
reverse_proxy {{ host_directory }}:80
|
|
}
|
|
|
|
# All other frontend routes → /static/index.html
|
|
handle {
|
|
rewrite * /static/index.html
|
|
reverse_proxy {{ host_directory }}:80
|
|
}
|
|
}
|