spring-cloud / spring-cloud-gateway

An API Gateway built on Spring Framework and Spring Boot providing routing and more.
http://cloud.spring.io
Apache License 2.0
4.52k stars 3.32k forks source link

Error through nginx'80 port, but ok on others #483

Closed yuweihn closed 5 years ago

yuweihn commented 6 years ago

When I call websocket through spring cloud gateway, it's ok when i use websocket's non 80 port, but it goes wrong on 80.

image

image

The follow is nginx setting. image

Base on springboot-2.0.3.RELEASE, springcloud-Finchley.RELEASE, nginx-1.13.9

yuweihn commented 6 years ago

Is there anybody can help me?

spencergibb commented 6 years ago

I'm afraid we don't have enough information to go in. What is the error? How do I reproduce it?

Can you provide a complete, minimal, verifiable sample that reproduces the problem? It should be available as a GitHub (or similar) project or attached to this issue as a zip file.

yuweihn commented 6 years ago

z-gateway.zip

client.zip

yuweihn commented 6 years ago

In the file 'client.html', you can switch the two statements. The first is wrong, the second is ok.

image

spencergibb commented 6 years ago

I'm sorry, I need something I can run on my machine that doesn't depend on an external config server

yuweihn commented 6 years ago

z-websocket.zip

You can run 'z-websocket.zip' as a service supplier behind nginx. Websocket handshake would fail in this call chain [gateway ===>>> nginx(80) ===>>> websocket]. But it is ok like this [gateway ===>>> nginx(2018) ===>>> websocket].

@spencergibb

spencergibb commented 5 years ago

Closing this due to inactivity. Please re-open if there's more to discuss.