如何使Service Fabric反向代理在Azure上运行 [英] How to get Service Fabric Reverse Proxy to work on Azure

查看:93
本文介绍了如何使Service Fabric反向代理在Azure上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个Azure Service Fabric Web API,并计划通过Service Fabric的内置反向代理对其进行访问.

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

在本地所有工作都很好,但是当我发布到Azure时,尝试通过反向代理访问路由会超时.

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

我认为这可能是我的应用程序,所以我只是打开了一个使用默认模板的新解决方案,并发布到我的本地.一切正常,反向代理和所有.因此,我发布到Azure并再次遇到相同的问题.

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.

例如,我可以通过正常路线(通过服务的端点)访问Azure上的Web API:

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

但是通过反向代理端口19081超时:

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

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

我确实确保在Azure上设置群集资源时勾选了启用反向代理",并将端口设置为19081.以上两种方法在localhost上都可以正常运行,但是只有正常路由在Azure上可以使用.

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.

想知道是否需要对清单进行一些额外的编辑,或者我需要做些什么才能使其在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?

推荐答案

您是否看到了

Did you see the documentation on how to configure it?

如果要在Internet上公开服务,请注意,内置服务会导致每个服务都公开,它没有经过强化,很容易受到DOS攻击. 文档

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

我建议看看Traefik作为反向代理和负载平衡器. 您可以将它作为群集中的(容器化)入口路由服务运行,并将HTTP调用定向到您的服务.

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.

或者,您可以使用 Api Gateway ,它也与SF集成在一起. 甚至 Nginx .

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

这篇关于如何使Service Fabric反向代理在Azure上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆