- reverse to the same machine 192.168.48.241
:2020 {
respond "from 192.168.48.241:2020, Hello"
log {
output file access.2020.log
}
}
:3030 {
reverse_proxy :2020
log {
output file access.3030.log
}
- Result, "from 192.168.48.241:2020, Hello", from the followings
- reverse to different in local net
- machine one 192.168.48.241
:2020 {
respond "from 192.168.48.241:2020, Hello"
log {
output file access.2020.log
}
}
:3030 {
reverse_proxy 192.168.48.245:2020
log {
output file access.3030.log
}
- machine two 192.168.48.245
:2020 {
respond "from 192.168.48.245:2020, Hello"
log {
output file access.2020.log
}
}
- reverse to machine in global space , h2jammy.yushei.net, 59.126.118.193
:2020 {
respond "from 192.168.11.248:2020, Hello. While 59.126.118.193(h2jammy.yushei.net):2020 will fail to respond"
# respond "59.126.118.193(h2jammy.yushei.net):2020 will fail to respond"
log {
output file access.2020.log
}
}
2023/07/02 23:55:38.573 INFO http.log.access handled request {"request": {"remote_ip": "210.242.152.235", "remote_port": "49354", "proto": "HTTP/1.1", "method": "GET", "host": "localhost:3030", "uri": "/favicon.ico", "headers": {"X-Forwarded-For": ["::1"], "Accept": ["image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8"], "Sec-Fetch-Site": ["same-origin"], "Accept-Language": ["en-US,en;q=0.9"], "Sec-Ch-Ua-Platform": ["\"Linux\""], "User-Agent": ["Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"], "Accept-Encoding": ["gzip, deflate, br"], "Sec-Fetch-Mode": ["no-cors"], "X-Forwarded-Proto": ["http"], "Sec-Ch-Ua-Mobile": ["?0"], "Sec-Fetch-Dest": ["image"], "Sec-Ch-Ua": ["\"Not.A/Brand\";v=\"8\", \"Chromium\";v=\"114\""], "X-Forwarded-Host": ["localhost:3030"], "Referer": ["http://localhost:3030/"]}}, "user_id": "", "duration": 0.000007183, "size": 0, "status": 0, "resp_headers": {"Server": ["Caddy"]}}