Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于Caddy的反向代理 #122

Closed
panda2134 opened this issue Aug 7, 2019 · 1 comment
Closed

关于Caddy的反向代理 #122

panda2134 opened this issue Aug 7, 2019 · 1 comment

Comments

@panda2134
Copy link
Contributor

不知道写这里合不合适,但是这里面有个大坑

大家看到 nginx 和 apache 的反向代理就可能会想到要单独配置 websocket 代理,像这样:
(注意这个是错的!)

example.site {
  proxy / 127.0.0.1:23333 transparent
  proxy /websocket/ws ws://127.0.0.1:23333/websocket/ws websocket
}

但是这个根本用不了。可能是caddy有bug,这么写并不会dial本地的websocket,而是会dial一个奇怪的地址(像我这是64.70.19.33:80),导致 502.
经过几个小时的踩坑,我发现必须要把两个条目写在一起! e.g.

example.site {
  proxy / 127.0.0.1:23333 transparent websocket
}

这样就可以用了
@Suwings 不知道能不能加到README.md的反向代理设置教程里面

@unitwk
Copy link
Member

unitwk commented Aug 7, 2019

已添加,有其他情况也可以继续在此 issue 讨论。

@unitwk unitwk closed this as completed Mar 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants