Screenshot_20201205_170333.png

proxy
The v2 equivalent is reverse_proxy.

Notable subdirective changes are header_upstream and header_downstream
have become header_up and header_down, respectively; and
load-balancing-related subdirectives are prefixed with lb_.

One other significant difference is that the v2 proxy passes all
incoming headers thru by default (including the Host header) and sets
the X-Forwarded-For header. In other words, v1's "transparent" mode is
basically the default in v2 (but if you need other headers like
X-Real-IP you have to set those yourself). You can still
override/customize the Host header using the header_up subdirective.

Websocket proxying "just works" in v2; there is no need to "enable"
websockets like in v1.

The without subdirective has been removed because rewrite hacks are no
longer necessary in v2 thanks to improved matcher support.
根据以上提示可以将

mydomain.me
{
  proxy /ray localhost:10000 {
    websocket
    header_upstream -Origin
  }
}

转化为

mydomain.me
{
  reverse_proxy /ray localhost:10000
}

非常简短

最后修改:2020 年 12 月 05 日 05 : 04 PM
如果觉得我的文章对你有用,请随意赞赏!