dpztth71739 2017-01-30 13:24
浏览 237
已采纳

如何在专用服务器上运行多个Golang应用程序? [关闭]

I'm a Go newbie and I'm stuck trying to figure out how to deploy my apps on a dedicated server.

When I worked with PHP I used the standard setup:

Apache and PHP diagram

But I'm confused as to how I'm supposed to deploy my Go apps.

I know I can run a single app on port :80 but how do I run multiple apps?

Is this the general idea:

Multiple apps diagram

Or should I be using something like this:

Nginx diagram

Can someone clarify the way most Go developers deploy their apps? Thanks!

  • 写回答

3条回答 默认 最新

  • dongxunhua2054 2017-01-30 13:50
    关注

    I'd highly recommend going with Caddy. You can set up you server with all the apps on different ports (esp. higher ports i.e. 1024 and up, so they don't need to be root), and then use proxy directives to forward traffic to your apps and such. As a bonus, you also then get free Let's Encrypt certificate support!

    https://caddyserver.com/docs/proxy for more on the proxy directive

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?