Closed chenxudong2020 closed 1 month ago
I try to write a Caddyfile
but it not works. can you resolve it?
mysite.com:443 {
tls a@gmail.com
encode gzip
handle_path /mypathYWiWL* {
reverse_proxy 127.0.0.1:12948
}
handle {
reverse_proxy https://www.gov.cn {
trusted_proxies 0.0.0.0/0
header_up Host {upstream_hostport}
}
}
}
error looks like: Response { status: 200, version: HTTP/1.1, headers: {"alt-svc": "h3=\":443\"; ma=2592000", "server": "Caddy", "date": "Sun, 22 Sep 2024 08:40:23 GMT", "content-length": "0"}, body: None }
~# caddy -v
v2.8.4 h1:q3pe0wpBj1OcHFZ3n/1nl4V4bxBrYoSoab7rL9BMYNk=
the settings in nginx
likes
location /mypathWL/ {
proxy_redirect off;
proxy_pass http://127.0.0.1:12948;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
}
And this settings not work also:
fspaceinc.com:443 {
tls s@gmail.com
encode gzip
handle_path /mypathWiWL/* {
reverse_proxy http://127.0.0.1:12948 {
header_up Host {host}
header_up X-Real-IP {remote}
header_up X-Forwarded-For {remote}
header_up X-Forwarded-Proto {scheme}
header_up Upgrade {upstream_upgrade}
header_up Connection {upstream_connection}
}
}
handle {
reverse_proxy https://www.gov.cn {
trusted_proxies 0.0.0.0/0
header_up Host {upstream_hostport}
}
}
}
I tried the key point that nginx supports websocket configuration and converted it to caddy, but found it to be an old error. I am not familiar with caddy and only want to use its automatic certificate application to configure multi domain sharing 443. However, I found that it does not work and can only wait for someone familiar with it to improve. Recently, I found that the previous nginx configuration also reported an error, and I am not sure if it is due to overtls upgrade
Now overtls
can work with Caddy
, the Caddyfile
likes
mysite.com:443 {
tls s@gmail.com
encode gzip
reverse_proxy /mypathWiWL/* 127.0.0.1:12456
reverse_proxy https://www.sohu.com {
trusted_proxies 0.0.0.0/0
header_up Host {upstream_hostport}
}
}
Hope somebody can write an installation script.
Caddy installation script
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy
Caddy not support using IP as host name. so you must provide a domain name for your config file.
https://caddy.community/t/reverse-proxy-to-websocket-server-failed/25756/8
Do you mean to change 127.0.0.1 to a domain name?
https://github.com/ShadowsocksR-Live/overtls?tab=readme-ov-file#installation-script-with-caddy
https://github.com/ShadowsocksR-Live/overtls?tab=readme-ov-file#installation-script-with-caddy
I used a one click installation script and looked at the configuration file. It's basically the same as mine, except for tunnel_math. I have multiple others that are no different, but I still reported an error using Overtls win
Because the overtls.dll file shiped by ssrwin does not use the dll included in the latest 0.2.37 version.
I replaced this DLL file and it can be used now, but it still reports authentication failure because the locally launched one does not have authentication, which may be due to authentication information before the browser cache
If you have time to modify SSRWin, Docker can be migrated from nginx to Caddy later
ssrwin latest release have contained overtls.dll of 0.2.27 version.
How to use Caddy instead of nginx, it can automatically apply for certificates ,Can you help me?