Netflix / zuul

Zuul is a gateway service that provides dynamic routing, monitoring, resiliency, security, and more.
Apache License 2.0
13.43k stars 2.37k forks source link

How to configure Zuul2 as reverse proxy? #943

Closed SMakhrov closed 1 week ago

SMakhrov commented 3 years ago

Hi!

Could you tell how to configure Zuul2 as reverse proxy without Eureka? For example, if I want all requests which sending to http://localhost route to https://some-app.s3-us-west-2.amazonaws.com ? For example if I open http://localhost/index.html I need to be proxied to https://some-app.s3-us-west-2.amazonaws.com/index.html

I have tried different configurations but got 301 Moved permanently instead proxy pass to target url.

SMakhrov commented 3 years ago

For example this configuration at application.properties doesn't work (I got 301 answer when try to open http://localhost/index.html):

zuul.server.port.main=80

# Loading Filters Paths
zuul.filters.root=com.example.cs.sample.filters
zuul.filters.packages=${zuul.filters.root}.endpoint,${zuul.filters.root}.inbound,${zuul.filters.root}.outbound

# Deactivate Eureka
eureka.shouldFetchRegistry=false
eureka.validateInstanceId=false

# Load balancing

api.ribbon.listOfServers=some-app.s3-us-west-2.amazonaws.com:80
api.ribbon.client.NIWSServerListClassName=com.netflix.loadbalancer.ConfigurationBasedServerList

@artgon , could you please help me? I really can't understand how to fix it and do the simple thing with Zuul2 - reverse proxy.

SMakhrov commented 3 years ago

I guess that Zuul2 has similar problem as Zuul1 here: https://stackoverflow.com/questions/62547426/why-is-301-returned-in-spring-cloud-netflix-zuul-simplehostroutingfilter @spencergib said that it's known problem and was fixed in Zuul1.

DenisovaElena commented 3 years ago

+1

ZhukovaSD commented 3 years ago

+1

SMakhrov commented 3 years ago

I have tried to reproduce it with api.ribbon.listOfServers=httpbin.org:80 - it works. But for amazon S3 it doesn't work - api.ribbon.listOfServers=some-app.s3-us-west-2.amazonaws.com:80 (it's fake url, you can create your own public s3 to test it).

dark-kraft commented 3 years ago

+1

lab85-ru commented 3 years ago

Cool !

SMakhrov commented 3 years ago

A month has passed and there is no any answer. Zuul 2 is no longer supported? @carl-mastrangelo, @artgon ?

github-actions[bot] commented 2 weeks ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 1 week ago

This issue was closed because it has been stalled for 7 days with no activity.