2023-09-07 20:06:52 +02:00
|
|
|
# Multiple Backends Example
|
|
|
|
#
|
2023-12-20 14:49:50 +01:00
|
|
|
|
|
|
|
# global config must be first
|
|
|
|
{
|
|
|
|
# no listen on 2019/tcp with admin API
|
|
|
|
admin off
|
|
|
|
}
|
|
|
|
|
|
|
|
# zrok site block
|
2023-08-31 20:05:13 +02:00
|
|
|
http:// {
|
2023-09-07 20:06:52 +02:00
|
|
|
# Bind to the zrok share
|
2023-11-02 22:08:10 +01:00
|
|
|
bind {{ .ZrokBindAddress }}
|
2023-09-07 20:06:52 +02:00
|
|
|
|
|
|
|
# Handle paths starting with `/zrok/*`
|
|
|
|
# This will also strip the `/zrok/` from the path before sending to the backend
|
2023-11-02 22:08:10 +01:00
|
|
|
handle_path /zrok/* {
|
|
|
|
reverse_proxy https://zrok.io {
|
|
|
|
header_up Host zrok.io
|
|
|
|
}
|
|
|
|
}
|
2023-09-07 20:06:52 +02:00
|
|
|
|
2023-11-02 22:08:10 +01:00
|
|
|
# serve index.html if it exists, else a file index
|
|
|
|
handle_path /zrok-static/* {
|
|
|
|
root * /var/www/html
|
|
|
|
file_server browse
|
|
|
|
}
|
|
|
|
|
|
|
|
# All other traffic goes to localhost:3000
|
|
|
|
reverse_proxy /* 127.0.0.1:3000 {
|
|
|
|
header_up Host localhost:3000
|
2024-06-30 18:59:34 +02:00
|
|
|
header_up X-Real-IP {http.request.header.x-forwarded-for}
|
2023-11-02 22:08:10 +01:00
|
|
|
}
|
2023-08-31 20:05:13 +02:00
|
|
|
}
|