Closed sawa-ko closed 1 month ago
Update: I have opted for a json configuration, but when I try to connect through port 82, in this example, it just doesn't work.
root@x ~ # telnet x.x.xx.xx 82
Trying x.x.xx.xx...
Connected to x.x.xx.xx.
Escape character is '^]'.
Connection closed by foreign host.
root@madoka ~ # curl x.x.xx.xx:82
curl: (56) Recv failure: Connection reset by peer
{
"apps": {
"http": {
"servers": {
"example_server": {
"listen": [":80"],
"routes": [
{
"match": [
{
"host": ["subdomain.example.com"]
}
],
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "10.10.10.2:8000"
}
]
}
]
}
]
}
}
},
"layer4": {
"servers": {
"rdp_server": {
"listen": [":82"],
"routes": [
{
"match": [
{
"rdp": {}
}
],
"handle": [
{
"handler": "proxy",
"upstreams": [
{
"dial": ["10.10.10.3:3389"]
}
]
}
]
}
]
}
}
},
"tls": {
"certificates": {
"automate": ["subdomain.example.com"]
},
"automation": {
"policies": [
{
"issuers": [{"module": "internal"}]
}
]
}
}
},
"admin": {
"listen": ":81"
}
}
@sawa-ko I can see two problems in your config:
tls
handler before proxy
handler while multiplexing RDP, because RDP is encrypted itself.A working config example:
{
layer4 {
:443 {
@rdp rdp
route @rdp {
proxy 10.10.10.3:3389
}
@tls tls
route @tls {
tls
proxy localhost:80
}
}
}
}
I am trying to connect a domain to a windows virtual machine, but I can't get it to work, because when I try to connect to the domain it does not work. The domain simply does not work.
This is my entire caddy configuration file:
The port as you can see is working properly (host machine):
The virtual machine is on a nat network, which the virtual machine that has the caddy has access to.