Closed AP0rPi7uQ9 closed 4 years ago
Questions are preferred to go to the forum https://caddy.community
To proxy different FQDN to different backends, you need to forget about the CLI and use the JSON config or Caddyfile. You'll find complete example in the wiki here https://github.com/caddyserver/caddy/wiki/v2:-Config-from-Scratch
You can get this up and running very easily with Caddy 1
Questions are preferred to go to the forum https://caddy.community
To proxy different FQDN to different backends, you need to forget about the CLI and use the JSON config or Caddyfile. You'll find complete example in the wiki here https://github.com/caddyserver/caddy/wiki/v2:-Config-from-Scratch
Thank you very much! you are kind and help me a lot. I'm newbie in github.
But i found a problem.
when i "listen": ["127.0.0.1:80"], i cant open the web in client. But when i use "listen": [":80"], its successful, i can open it.
If you use "listen": ["127.0.0.1:80"]
then only clients on the same machine can access the served website. If you need access to the website from an external device, then you can't use "listen": ["127.0.0.1:80"]
.
I have two website written by Golang Gin Framework. I want to do this. When i open abc123.com, i can see localhsot:8080 page. When i open def456.com, i can see localhsot:8081 page.
But in terminal line , i type this two line
$ caddy reverse-proxy --from https://abc123.com --to localhost:8080 $ caddy reverse-proxy --from https://def456.com --to localhost:8081
and return [reverse-proxy: loading new config: http app module: start: tcp: listening on :443: listen tcp :443: bind: address already in use]
Only one website is avalible. WHy? I need help. thanks