Comments (6)
Sure, I had to add another matcher so that it knows what subdomain to listen for.
So the config ended up being
"layer4": {
"servers": {
"srv0": {
"listen": [
":443"
],
"routes": [
{
"match": [
{
"host": [
"ssh.mydomain.com"
]
}
],
"match": [
{
"ssh": {}
}
],
"handle": [
{
"handler": "proxy",
"upstreams": [
{
"dial": [
"192.168.0.11:22"
]
}
]
}
]
}
]
}
}
}
from caddy-l4.
NVM, I figured it out, You can close this !
Mind sharing the solution with us in case others stumble upon the same issue?
from caddy-l4.
NVM, I figured it out, You can close this !
from caddy-l4.
@gt2416 Hmm, that's odd. There is no host
matcher in layer4, without the http
matcher first. And you have two match
keys where one is overriding the other (second is kept).
I suspect you did something else different to make it work.
from caddy-l4.
If I remove that matcher it stops working, however I know it is not matching anything. Its just that the ssh.mydomain.com isnt there anywhere else in the file.
If I try adding a second block with ssh2.mydomain.com to proxy to ip2, it lets me ssh but goes to proxy ip1 (the one defined for ssh.mydomain.com) so yea Im def doing something weird.
Like I said I don't know how to use json, what I do is write my caddy file, copy the json from the autosave location and add this layer4 code block at the end. My json file is 650lines, I dont plan to learn to use it completely lol, caddyfile is a lot easier.
How would I go about doing this, ssh.mydomain.com -- IP1, ssh2.mydomain.com --IP2 ?
from caddy-l4.
If I remove that matcher it stops working, however I know it is not matching anything. Its just that the ssh.mydomain.com isnt there anywhere else in the file.
Sure, but that shouldn't affect SSH, which doesn't use HTTP or TLS.
Like I said I don't know how to use json, what I do is write my caddy file, copy the json from the autosave location and add this layer4 code block at the end.
Instead of using autosave, use the caddy adapt
command.
ssh.mydomain.com -- IP1, ssh2.mydomain.com --IP2 ?
I'm not sure what you mean. SSH doesn't distinguish hostnames like HTTP does.
from caddy-l4.
Related Issues (20)
- High CPU usage HOT 11
- how to graceful restart or shutdown HOT 2
- PR#141 Broke Matchers HOT 4
- How to match TLS SNI with proxy_protocol? HOT 2
- http active health check HOT 1
- [FEATURE]: Add support for access logs HOT 4
- http/2 corruption HOT 2
- Non blocking matchers & matching timeout breaking l4 as a listener wrapper HOT 13
- Collection of interesting configs HOT 1
- Feature request: `invoke` handler HOT 2
- Regression: PROXY protocol line sent only when first data arrives from client HOT 7
- Accept connections with an without PROXY protocol on the same port HOT 1
- Is it possible to use caddy's modules inside L4 routes? HOT 12
- SIGHUP for config reload? HOT 5
- Caddyfile does not recognize `layer4` global option HOT 8
- Cannot proxy to Mariadb instance HOT 8
- ``afa78d7`` update introduces a bug HOT 9
- Incorrect Handling of SNI: No Certificate Available (Regression) HOT 17
- RDP server on web subdomain with reverse proxy does not work HOT 2
- [Question] [Regression?] Upgrading Caddy from 2.7.6 to 2.8.4 with layer4 rebuild breaks SNI-based routing HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from caddy-l4.