How to get Service Fabric Reverse Proxy to work on Azure

孤人 提交于 2019-12-11 15:23:45

问题


I created a Azure Service Fabric Web API and planned to reach it through Service Fabric's built in Reverse Proxy.

All was working well locally but when I published to Azure, trying to access the route through Reverse Proxy would time out.

I thought it might be my app, so I just popped open a new solution with the default template and published to my local. Everything worked fine Reverse Proxy and all. So I published to Azure and again had the same issue.

I could access the Web API on azure through the normal route (through the endpoint of the service) for example:

xxxx.east.cloudapp.azure:8080/api/values

But going through the Reverse Proxy port of 19081 times out:

xxxx.east.cloudapp.azure:19081/[app]/[service]/api/values

I did make sure to tick off Enable Reverse Proxy when setting up the cluster resource on Azure, and set the port to 19081. Both of the above works fine on localhost, but only the normal route works on Azure.

Was wondering if there's some extra editing of the manifest or something I had to do to make it work on Azure correctly?


回答1:


Did you see the documentation on how to configure it?

If you're going to expose services on the internet, be aware that the built-in one causes every service to become exposed, it's not hardened, it's vulnerable to DOS attacks. Docs

I recommend having a look at Traefik as a reverse proxy and load balancer. You can run it as a (containerized) ingress routing service inside the cluster, and direct HTTP calls to your services.

  • Here's the documentation.
  • Here's how to get started.
  • Here's an example.

Alternatively, you can use Api Gateway, which integrates with SF too. Or even Nginx.



来源:https://stackoverflow.com/questions/55574564/how-to-get-service-fabric-reverse-proxy-to-work-on-azure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!